Chat Completions
POST /api/v1/chat/completions
Base URL
https://app.eigenai.com
Authentication
Send your API key in theAuthorization header as a Bearer token.
Parameters
Common
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | The model ID to use. Find supported models in the Model Library. |
messages | array | Required | Conversation history as an array of { role, content } items. |
Conditional
These options are not supported by every model. Use the Model Library to confirm compatibility.Generation Controls
Common tuning knobs for output length and randomness (availability varies by model).| Name | Type | Required | Description |
|---|---|---|---|
temperature | number | Optional | Controls randomness/creativity. Higher values produce more varied outputs. |
max_tokens | number | Optional | Maximum number of tokens to generate in the response. |
top_p | number | Optional | Nucleus sampling. Limits token selection to the smallest set with cumulative probability top_p. |
top_k | number | Optional | Top-k sampling. Limits token selection to the top k candidates. |
min_p | number | Optional | Minimum probability threshold sampling (if supported). |
repetition_penalty | number | Optional | Penalizes repeating tokens (if supported). |
Streaming
Receive partial outputs incrementally.| Name | Type | Required | Description |
|---|---|---|---|
stream | boolean | Optional | Set to true to stream output via server-sent events (SSE). |
Vision Input (Multi-part Message Content)
Some models accept mixed text + image inputs by using an array forcontent on a message.
| Name | Type | Required | Description |
|---|---|---|---|
messages[].content | string|array | Optional | For vision requests, content can be an array of parts like { type: "text" } and { type: "image_url" }. |