[ 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

JSON over HTTPS

Version
v1

Stable path prefix

Auth
Bearer

Keys under development

Limits
Tiered

See rate limits docs

Endpoints

Stable /v1 paths. Chat completions is the primary surface; models endpoints expose capability metadata.

POST
/v1/chat/completions

Create a chat completion with Origin or NextGen. Supports streaming via stream: true.

GET
/v1/models

List available models and capability metadata.

GET
/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.

Request
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
  }'
Response
{
  "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].

Stream request
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."}
    ]
  }'
SSE chunks
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.

CodeNameDetail
400invalid_requestMalformed JSON, missing fields, or unsupported parameters.
401unauthorizedMissing or invalid Bearer token.
403forbiddenKey valid but not permitted for this model or action.
404not_foundUnknown model id or path.
429rate_limitedToo many requests — back off using Retry-After when present.
500server_errorTransient failure — retry with jitter.

Models

Pass these ids in model. Full specs live on the models pages.

IdContextLatencyBest for
origin128K tokens~18msOur fastest, most responsive model — built for pure speed.
nextgen1M tokens~20msOur most advanced model — designed for the future.

[ Next ]

Auth docs. Quark today.

Wire against the contract and authentication guide. Prototype in Quark while API keys remain under development.