DOCS / V1 / CAPABILITIES
CAPABILITIES

Tools & JSON mode

Function calling and structured output using the OpenAI formats.

Function calling

Pass tools. The model answers with tool_calls; run the function, append the result as a tool message, and call again. With model: "auto" the router only considers models that support tools.

ParameterTypeDescription
toolsobject[]Array of {"type":"function","function":{name, description, parameters}}. parameters is a JSON Schema.
tool_choicestring | objectauto lets the model decide, none disables tools, or name a function to force it.
response_formatobject{"type":"json_object"} makes the reply valid JSON. Mention JSON in your prompt.
curl https://api.eggsplain.com/v1/chat/completions \
  -H "Authorization: Bearer $EGGSPLAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "auto",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Current weather for a city",
        "parameters": {
          "type": "object",
          "properties": { "city": { "type": "string" } },
          "required": ["city"]
        }
      }
    }
  ],
  "tool_choice": "auto",
  "messages": [
    {
      "role": "user",
      "content": "What'\''s the weather in Stockholm?"
    }
  ]
}'

JSON mode

Set response_format to {"type": "json_object"}. The reply content is a JSON string you can parse.

curl https://api.eggsplain.com/v1/chat/completions \
  -H "Authorization: Bearer $EGGSPLAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "auto",
  "response_format": { "type": "json_object" },
  "messages": [
    {
      "role": "user",
      "content": "Reply in JSON with keys capital and country for France."
    }
  ]
}'

Streaming

Tool calls stream as deltas when stream is on. The tester reassembles them for you.