OpenAIOpenAI API
POST/completions
Manage create Completion.
Contract-preserving POST Endpoint for create Completion in the OpenAI API. Model and resource-specific values are supplied by the caller at runtime.
All 288 OpenAI Platform REST endpoints from a fixed MIT-licensed official revision, including typed SSE streaming and Realtime call management. Hub provides documentation and an independent SDK/CLI, but never proxies model, account, or usage data; callers connect directly with local API keys.
Request
- operationId
createCompletion- Server
https://api.openai.com/v1- Authentication
- ApiKeyAuth, AdminApiKeyAuth
Request parameters
No URL, query, or header parameters.
Request body
CreateCompletionRequestrequired
Content-Type: application/json
Properties: best_ofechofrequency_penaltylogit_biaslogprobsmax_tokensmodelnpresence_penaltypromptseedstopstreamstream_optionssuffixtemperaturetop_puser
Responses
200
CreateCompletionResponseapplication/json
Successful supplier response.
Properties: choicescreatedidmodelobjectsystem_fingerprintusage
429
ErrorResponseapplication/json
Supplier response with HTTP status 429.
Properties: error
{
"choices": [
{
"finish_reason": "stop",
"index": 0
}
],
"created": 0,
"object": "text_completion",
"usage": {
"completion_tokens": 0,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0,
"text_tokens": 0
},
"prompt_tokens": 0,
"prompt_tokens_details": {
"audio_tokens": 0,
"cache_write_tokens": 0,
"cached_tokens": 0,
"image_tokens": 0,
"text_tokens": 0
},
"total_tokens": 0
}
}