API reference
Chat completions
POST /v1/chat/completions creates a reply for a conversation.
POST https://www.eon-agent.com/api/v1/chat/completionsRequest body
| Field | Type | Description |
|---|---|---|
| model | string | Use "eon". |
| messages | array | The conversation. Each item has role (system, user, assistant or tool) and content. |
| stream | boolean | Send the reply as server-sent events. Default false. |
| stream_options.include_usage | boolean | With stream, send a final chunk with token usage. |
| max_tokens | integer | Longest reply in tokens. Up to 1,024 with an API key. |
| temperature | number | Higher is more varied, lower is more focused. |
| tools | array | Functions the model may call. See Tools. |
| tool_choice | string or object | auto, none, required, or a specific function. |
Example
curl https://www.eon-agent.com/api/v1/chat/completions \
-H "Authorization: Bearer $EON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eon",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Write a haiku about orbit." }
]
}'