CORE API
Chat completions
The OpenAI-compatible generation endpoint. Same request shape, any model.
POST
/v1/chat/completionsSend a model and a non-empty messages array. Fields not listed below are passed through to the underlying model.
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | Model ID from List models, or auto to let the gateway choose. Accepts residency tags. |
messagesrequired | object[] | Conversation so far. Must contain at least one message. See the message object below. |
stream | boolean | Return the response as server-sent events. Defaults to false. See Streaming. |
temperature | number | Sampling temperature. Higher values give more varied output; lower values are more deterministic. |
top_p | number | Nucleus sampling cutoff. Usually set this or temperature, not both. |
max_tokens | integer | Maximum tokens to generate. Also used to estimate quota, so set it to what you need. |
max_completion_tokens | integer | OpenAI-style alias for the output token limit, including reasoning tokens. |
stop | string | string[] | Sequence(s) at which generation stops. |
seed | integer | Best-effort deterministic sampling. |
n | integer | Number of completions to generate. |
presence_penalty | number | Penalizes tokens that have already appeared, encouraging new topics. |
frequency_penalty | number | Penalizes tokens by how often they have appeared, reducing repetition. |
response_format | object | Output format, for example {"type":"json_object"}. See Tools & JSON mode. |
tools | object[] | Functions the model may call, in OpenAI tool format. |
tool_choice | string | object | Controls tool use: auto, none, or a specific function. |
stream_options | object | Streaming options. Usage is included in the final chunk by default; set include_usage to false to opt out. |
reasoning_effort | string | low, medium or high. See Reasoning. |
thinking | object | Provider-style thinking configuration, mapped to the model's native format. |
user | string | Your end-user identifier, for attribution. |
MESSAGE OBJECT
| Parameter | Type | Description |
|---|---|---|
rolerequired | string | system, user, assistant or tool. |
content | string | object[] | null | Message text, or an array of content parts (for example text and images). May be null on assistant messages that only carry tool calls. |
name | string | Optional participant name. |
tool_calls | object[] | Tool calls requested by an assistant message. |
tool_call_id | string | On tool messages, the ID of the call being answered. |
curl https://api.eggsplain.com/v1/chat/completions \
-H "Authorization: Bearer $EGGSPLAIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sovereign/gpt-6-luna",
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "Hello, eggsplain!" }
],
"temperature": 0.3,
"max_tokens": 200
}'Good to know
- Identical cacheable requests may be served from cache. Check
x-egg-cache. - Audio models are not accepted here; use speech to text.
- Edit the request body in the tester to try any parameter.