[ API Reference ]
REST API.
Base URL: https://api.idonai.com. Authenticate with a Bearer token when keys ship. API keys are under development — use this contract to prepare Origin and NextGen integrations.
- Protocol
- REST
- Version
- v1
- Auth
- Bearer
- Limits
- Tiered
JSON over HTTPS
Stable path prefix
Keys under development
See rate limits docs
Endpoints
Stable /v1 paths. Chat completions is the primary surface; models endpoints expose capability metadata.
/v1/chat/completionsCreate a chat completion with Origin or NextGen. Supports streaming via stream: true.
/v1/modelsList available models and capability metadata.
/v1/models/{model}Retrieve metadata for a single model id.
Chat completions
Create a completion with origin or nextgen. Replace $IDONAI_API_KEY when public keys are available.
curl https://api.idonai.com/v1/chat/completions \
-H "Authorization: Bearer $IDONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "origin",
"messages": [
{"role": "user", "content": "Explain quantum entanglement."}
],
"max_tokens": 1024
}'{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "origin",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum entanglement is..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 256,
"total_tokens": 268
}
}Streaming
Set stream: true to receive Server-Sent Events. Each event is a data: line with a partial delta; the stream ends with data: [DONE].
curl https://api.idonai.com/v1/chat/completions \
-H "Authorization: Bearer $IDONAI_API_KEY" \
-H "Content-Type: application/json" \
-N \
-d '{
"model": "nextgen",
"stream": true,
"messages": [
{"role": "user", "content": "Outline a 3-step plan."}
]
}'data: {"id":"chatcmpl-xyz","object":"chat.completion.chunk","choices":[{"delta":{"content":"Step"},"index":0}]}
data: {"id":"chatcmpl-xyz","object":"chat.completion.chunk","choices":[{"delta":{"content":" 1"},"index":0}]}
data: [DONE]Errors
Failures return JSON with a machine-readable name and human detail. Retry 429 and 500 with backoff.
| Code | Name | Detail |
|---|---|---|
| 400 | invalid_request | Malformed JSON, missing fields, or unsupported parameters. |
| 401 | unauthorized | Missing or invalid Bearer token. |
| 403 | forbidden | Key valid but not permitted for this model or action. |
| 404 | not_found | Unknown model id or path. |
| 429 | rate_limited | Too many requests — back off using Retry-After when present. |
| 500 | server_error | Transient failure — retry with jitter. |
Models
[ Next ]
Auth docs. Quark today.
Wire against the contract and authentication guide. Prototype in Quark while API keys remain under development.