đ Banner is live! Learn more
English
cURL
curl --request POST \ --url https://api.deepseek.com/beta/completions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: <content-type>' \ --data ' { "model": "deepseek-chat", "prompt": "Once upon a time, ", "echo": false, "frequency_penalty": 0, "logprobs": 0, "max_tokens": 1024, "presence_penalty": 0, "stop": null, "stream": false, "stream_options": null, "suffix": null, "temperature": 1, "top_p": 1 } '
{ "id": "string", "choices": [ { "finish_reason": "stop", "index": 0, "logprobs": { "text_offset": [ 0 ], "token_logprobs": [ 0 ], "tokens": [ "string" ], "top_logprobs": [ {} ] }, "text": "string" } ], "created": 0, "model": "string", "system_fingerprint": "string", "object": "text_completion", "usage": { "completion_tokens": 0, "prompt_tokens": 0, "prompt_cache_hit_tokens": 0, "prompt_cache_miss_tokens": 0, "total_tokens": 0, "completion_tokens_details": { "reasoning_tokens": 0 } } }
The FIM (Fill-In-the-Middle) Completion API. User must set base_url="https://api.deepseek.com/beta" to use this feature.
base_url="https://api.deepseek.com/beta"
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Show child attributes