About this endpoint
What it does
Creates an OpenAI-compatible chat completion through LLMAPI's unified multi-provider gateway.
Request
| Attribute | Type | Required | Description |
|---|---|---|---|
| model | String | Yes | Model identifier, for example zaya1-8b, or another model listed in the LLMAPI dashboard. |
| messages | Array | Yes | Conversation messages with role and content. |
| max_tokens | Integer | No | Maximum number of generated tokens. |
| temperature | Number | No | Sampling temperature. |
| stream | Boolean | No | Set to true for an event stream; use false in the APYHub playground. |
| tools | Array | No | OpenAI-compatible tool definitions. |
| response_format | Object | No | Optional structured-output configuration. |
| X-LLMAPI-Region | String | No | Preferred processing region. |
Additional OpenAI-compatible request fields are forwarded to LLMAPI.
Response
For non-streaming requests, returns an OpenAI-compatible JSON object containing id, model, created, choices, and usage. Each choice contains an assistant message and a finish_reason. Usage includes token and cost accounting when available.
Errors
Authentication, model, validation, provider, and rate-limit errors are returned with their upstream HTTP status and structured error body.