/completionsCreate a text completion
Creates a text completion for one or more prompts using the selected model and generation parameters. Supply model and prompt, then use options such as max_tokens, temperature if supported by the model, stop, and stream to control generation and delivery. Streaming returns partial progress events, while a non-streaming request returns a completion object.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
Text completion request containing the model, prompt, and optional generation controls. model and prompt are required.
One documented failure
slow_downYour request rate increased too quickly. Please reduce the request rate and gradually increase it again.
Traffic increased too quickly
One documented failure
server_is_overloadedThe model is temporarily overloaded. Please retry your request after a brief delay.
The requested model is temporarily overloaded
model and prompt are required. Keep best_of between 0 and 20, n between 1 and 128, logprobs between 0 and 5, and both penalty values between -2 and 2; best_of must be greater than n when both are used. A 429 is returned when the request rate exceeds the limit, and a 503 is returned when the service or requested model is temporarily unavailable.