ApiInference
Create a chat completion (OpenAI-compatible)
Authorization
bearerAuth AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The OpenAI chat completions request. Fields not listed are passed through to the model.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/inference/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "messages": [ { "role": "system" } ] }'{ "id": "string", "object": "chat.completion", "created": 0, "model": "string", "choices": [ { "index": 0, "message": { "role": "string", "content": "string", "reasoning_content": "string", "tool_calls": [ {} ] }, "finish_reason": "string" } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0, "prompt_tokens_details": { "cached_tokens": 0 }, "completion_tokens_details": { "reasoning_tokens": 0 }, "cost": 0 }}{ "error": { "message": "string", "type": "string", "code": 0 }}Empty
{ "error": { "message": "string", "type": "string", "code": 0 }}{ "error": { "message": "string", "type": "string", "code": 0 }}{ "error": { "message": "string", "type": "string", "code": 0 }}{ "error": { "message": "string", "type": "string", "code": 0 }}