DOCS / V1 / CORE API
CORE API

Chat completions

The OpenAI-compatible generation endpoint. Same request shape, any model.

POST/v1/chat/completions

Send a model and a non-empty messages array. Fields not listed below are passed through to the underlying model.

REQUEST BODY

ParameterTypeDescription
modelrequiredstringModel ID from List models, or auto to let the gateway choose. Accepts residency tags.
messagesrequiredobject[]Conversation so far. Must contain at least one message. See the message object below.
streambooleanReturn the response as server-sent events. Defaults to false. See Streaming.
temperaturenumberSampling temperature. Higher values give more varied output; lower values are more deterministic.
top_pnumberNucleus sampling cutoff. Usually set this or temperature, not both.
max_tokensintegerMaximum tokens to generate. Also used to estimate quota, so set it to what you need.
max_completion_tokensintegerOpenAI-style alias for the output token limit, including reasoning tokens.
stopstring | string[]Sequence(s) at which generation stops.
seedintegerBest-effort deterministic sampling.
nintegerNumber of completions to generate.
presence_penaltynumberPenalizes tokens that have already appeared, encouraging new topics.
frequency_penaltynumberPenalizes tokens by how often they have appeared, reducing repetition.
response_formatobjectOutput format, for example {"type":"json_object"}. See Tools & JSON mode.
toolsobject[]Functions the model may call, in OpenAI tool format.
tool_choicestring | objectControls tool use: auto, none, or a specific function.
stream_optionsobjectStreaming options. Usage is included in the final chunk by default; set include_usage to false to opt out.
reasoning_effortstringlow, medium or high. See Reasoning.
thinkingobjectProvider-style thinking configuration, mapped to the model's native format.
userstringYour end-user identifier, for attribution.

MESSAGE OBJECT

ParameterTypeDescription
rolerequiredstringsystem, user, assistant or tool.
contentstring | object[] | nullMessage text, or an array of content parts (for example text and images). May be null on assistant messages that only carry tool calls.
namestringOptional participant name.
tool_callsobject[]Tool calls requested by an assistant message.
tool_call_idstringOn 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.