Create a Text Completion changedapi/completions/create
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+34added
Lines−19removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits24to this page, all time
# Create a Text Completion ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Create a Text Completion ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The whole hunk
from line 1, old and new numbered
/
from line 1
1---
2title: Create a Text Completion
3url: https://platform.claude.com/docs/en/api/completions/create
4---
1# Create a Text Completion
52
6## Create a Text Completion
3**POST** `/v1/complete`
74
8**post** `/v1/complete`
9
105[Legacy] Create a Text Completion.
116
127The Text Completions API is a legacy API. We recommend using the [Messages API](https://platform.claude.com/docs/en/api/messages) going forward.
from line 8
138
149Future models and features will not be compatible with Text Completions. See our [migration guide](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) for guidance in migrating from Text Completions to Messages.
1510
16### Header Parameters
11## Headers
1712
1813- `"anthropic-beta": optional array of AnthropicBeta`
1914
from line 86
9186
9287 - `"mid-conversation-tool-changes-2026-07-01"`
9388
94### Body Parameters
89## Body parameters
9590
9691- `max_tokens_to_sample: number`
9792
from line 94
9994
10095 Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
10196
97 minimum: 1
98
10299- `model: Model`
103100
104101 The model that will complete your prompt.
from line 190
193190
194191 See [prompt validation](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) and our guide to [prompt design](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) for more details.
195192
193 minLength: 1
194
196195- `metadata: optional Metadata`
197196
198197 An object describing metadata about the request.
from line 202
203202
204203 This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
205204
205 maxLength: 512
206
206207- `stop_sequences: optional array of string`
207208
208209 Sequences that will cause the model to stop generating.
from line 220
219220
220221- `temperature: optional number`
221222
223 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 of will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
224
222225 Amount of randomness injected into the response.
223226
224227 Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.
from line 228
225228
226229 Note that even with `temperature` of `0.0`, the results will not be fully deterministic.
227230
231 maximum: 1, minimum: 0
232
228233- `top_k: optional number`
229234
235 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.
236
230237 Only sample from the top K options for each subsequent token.
231238
232239 Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
from line 240
233240
234241 Recommended for advanced use cases only.
235242
243 minimum: 0
244
236245- `top_p: optional number`
237246
247 **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.
248
238249 Use nucleus sampling.
239250
240251 In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.
from line 252
241252
242253 Recommended for advanced use cases only.
243254
244### Returns
255 maximum: 1, minimum: 0
245256
246- `Completion object { id, completion, model, 2 more }`
257## Returns
247258
259- `Completion object`
260
248261 - `id: string`
249262
250263 Unique object identifier.
from line 357
344357
345358 For Text Completions, this is always `"completion"`.
346359
347 - `"completion"`
360 default: completion
348361
349### Example
362- `Completion object`
350363
351```http
364## Example
365
366```bash
352367curl https://api.anthropic.com/v1/complete \
353368 -H 'Content-Type: application/json' \
354369 -H 'anthropic-version: 2023-06-01' \
from line 379
364379 }'
365380```
366381
367#### Response
382### Response (200)
368383
369384```json
370385{
No line in this hunk matches that.