Create chat completion
POST/chat/completions
Sends a chat prompt to a deployed model and returns a completion. Supports both streaming (server-sent events) and non-streaming response modes. Use the model field to target a base model or a deployed fine-tuned model by its model_name. Optional sampling parameters include temperature, top_p, top_k, max_tokens, presence_penalty, and repetition_penalty. Total tokens (prompt + completion) must not exceed the model's context window.
Request
Responses
- 200
- 400
- 401
- 404
- 422
The request was invalid. This includes sending image content to a model that does not support image input, which returns the error "Model X does not support image input."
Unauthorized
Not Found
Validation Error
Was this page helpful?