Terminaili
Menu

API Reference

Endpoint maps, parameters, limits, token accounting, and error shapes for the Terminaili public API.

v1

Endpoint Map

Public API endpoints are rooted at https://api.terminaili.com/v1.

EndpointMethodUse
/v1/openapi.jsonGETRead the public OpenAPI contract.
/v1/chat/completionsPOSTCreate OpenAI-compatible chat completions.
/v1/embeddingsPOSTCreate OpenAI-compatible embeddings.
/v1/modelsGETList public models and model groups.
/v1/models/{model_id}GETInspect one public model.
/v1/statusGETRead public model availability.
/v1/readyGETRead first-request readiness and setup checks.
/v1/estimatePOSTEstimate tokens and cost before execution.
/v1/agent-capabilitiesGETDiscover agent-client capabilities and generated config URLs.
/v1/agent-turnsPOSTCreate a resumable agent-native coding turn.
/v1/agent-turns/{request_id}GETRead a resumable agent turn.
/v1/agent-turns/{request_id}/eventsGETResume agent turn events with Server-Sent Events.
/v1/agent-turns/{request_id}/cancelPOSTCancel a running agent turn.
/v1/agent-tool-batches/planPOSTPlan local tool-call execution batches.
/v1/client-config/opencodeGETGenerate OpenCode client configuration.
/v1/client-config/opencode/freshnessGETCheck saved OpenCode config freshness.
/v1/client-config/hermesGETGenerate Hermes client configuration.
/v1/client-config/hermes/freshnessGETCheck saved Hermes config freshness.
/v1/orchestrationsGET/POSTList or create hosted multi-agent orchestration runs.
/v1/orchestrations/{id}GETRead one hosted orchestration run.
/v1/orchestrations/{id}/eventsGETReplay hosted orchestration events.
/v1/orchestrations/{id}/tasksGETList hosted orchestration role tasks.
/v1/orchestrations/{id}/locksGETList hosted orchestration path locks.
/v1/orchestrations/{id}/artifactsGETList hosted orchestration artifacts.
/v1/orchestrations/{id}/candidatesGETList merge candidates and review results.
/v1/orchestrations/{id}/cancelPOSTCancel a hosted orchestration.
/v1/orchestrations/{id}/mergePOSTRequest merge arbitration.
/v1/orchestrations/{id}/undoPOSTRequest merge undo using checkpoint or rollback artifacts.
/v1/orchestrations/{id}/tasks/{task_id}/retryPOSTRetry an eligible role task.
/v1/filesGET/POSTList your uploaded files or upload a new file (batch input, fine-tune training data).
/v1/files/{file_id}GET/DELETERead or delete one of your uploaded files.
/v1/files/{file_id}/contentGETDownload the raw bytes of a previously uploaded file.
/v1/batchesGET/POSTList your batch jobs or create a new batch from an uploaded JSONL file. Billed at 50% of realtime per token.
/v1/batches/{batch_id}GETRead one batch job, including request_counts and the output file id when complete.
/v1/batches/{batch_id}/cancelPOSTRequest cancellation of a running batch job.
/v1/solana-rpc/plansGETList Solana RPC access plans.
/v1/solana-rpc/methodsGETList tested Solana RPC methods.
/v1/solana-rpc/{network}POSTProxy Solana JSON-RPC for mainnet or devnet.
/v1/projects/{project_id}/boxGETRead Project Box documents, usage, and query history.
/v1/projects/{project_id}/box/documentsPOSTUpload a Project Box document for indexing.
/v1/projects/{project_id}/box/documents/{document_id}GET/DELETERead or delete one Project Box document.
/v1/projects/{project_id}/box/documents/{document_id}/sourceGETDownload a Project Box source document.
/v1/projects/{project_id}/box/documents/{document_id}/chunks/{chunk_id}GETRead one Project Box source chunk.
/v1/projects/{project_id}/box/documents/{document_id}/reindexPOSTQueue Project Box reindexing.
/v1/projects/{project_id}/box/queryPOSTAsk a cited question over Project Box documents.
/v1/projects/{project_id}/secretsGETList Project Secrets metadata without returning raw values.
/v1/projects/{project_id}/secrets/{name}PUT/DELETECreate, rotate, or delete one Project Secret.
/v1/projects/{project_id}/app-configGETRead app configuration readiness and required secret hints.
/v1/projects/{project_id}/jobsGET/POSTList or create background job definitions.
/v1/projects/{project_id}/cronGET/POSTList or create cron schedules that enqueue job runs.
/v1/projects/{project_id}/jobs/{job_id}/runsPOSTStart a manual job run.
/v1/projects/{project_id}/job-runsGETList job run history.
/v1/projects/{project_id}/job-runs/{run_id}GETRead one job run with logs and status.
/v1/projects/{project_id}/job-runs/{run_id}/retryPOSTRetry a failed or completed job run.
/v1/projects/{project_id}/queues/{queue_name}/messagesGET/POSTList or enqueue JSON queue messages.
/v1/projects/{project_id}/webhooksGET/POSTList or create event webhook subscriptions.
/v1/projects/{project_id}/webhooks/{webhook_id}/disablePOSTDisable one webhook subscription.
/v1/projects/{project_id}/webhooks/{webhook_id}/rotate-secretPOSTRotate and reveal a webhook signing secret once.
/v1/projects/{project_id}/webhook-deliveriesGETList webhook delivery attempts and retry state.
/v1/projects/{project_id}/webhook-deliveries/{delivery_id}/replayPOSTQueue a replay for one webhook delivery.
/v1/projects/{project_id}/eventsGETRead supported event names and recent project events.
/v1/projects/{project_id}/databasesGET/POSTList or attach/provision Postgres handoff databases.
/v1/projects/{project_id}/databases/{database_id}GETRead one database attachment without exposing the full URL.
/v1/projects/{project_id}/databases/{database_id}/rotate-credentialsPOSTRotate DATABASE_URL through Project Secrets.
/v1/projects/{project_id}/databases/{database_id}/attach-hosted-appPOSTAttach a database to a hosted app.
/v1/usageGETList public-safe usage summaries.
/v1/account/meter-eventsGETList account meter events.
/v1/account/meter-events/exportGETExport account meter events.
/v1/request-historyGETList sanitized retained request history.
/v1/account/provider-credentialsGET/POSTList or create provider credentials.
/v1/account/provider-credentials/{credential_id}PATCH/DELETEUpdate or delete one provider credential.
/v1/account/provider-credentials/{credential_id}/testGETTest one provider credential.

Chat Completions

The primary compatibility endpoint for OpenAI SDKs and coding agents.

OpenAPI JSON
POSThttps://api.terminaili.com/v1/chat/completions
AuthAuthorization: Bearer $TERMINAILI_API_KEY
ParameterTypeRequiredDescription
modelstringRequiredPublic model id to use, for example TERMINAILI_MODEL.
messagesarrayRequiredOpenAI-compatible chat messages with role and content.
streambooleanOptionalSet true for Server-Sent Events when the model supports streaming.
toolsarrayOptionalOpenAI-compatible tool definitions for agentic clients.
tool_choicestring | objectOptionalLet the model choose tools, force one, or disable tools.
seedintegerOptionalRequest deterministic sampling where supported.
stopstring | arrayOptionalStop generation before one of the provided sequences.
response_formatobjectOptionalRequest JSON output where the selected model supports it.
temperaturenumberOptionalSampling temperature. Use lower values for deterministic coding tasks.
top_pnumberOptionalNucleus sampling control, forwarded when supported.
max_tokensnumberOptionalMaximum output tokens for the completion.
max_completion_tokensnumberOptionalOpenAI-compatible output-token limit; overrides max_tokens.
Response
{
  "id": "chatcmpl_...",
  "object": "chat.completion",
  "model": "ipop/coder-balanced",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello. Terminaili is ready."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  },
  "ipop": {
    "request_id": "req_...",
    "cost_usd": 0.00042,
    "cache_hit": false
  }
}

Token Usage

Chat and embeddings responses include OpenAI-compatible usage fields when the model reports them.

Response usage
{
  "id": "chatcmpl_...",
  "object": "chat.completion",
  "model": "ipop/coder-balanced",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello. Terminaili is ready."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  },
  "ipop": {
    "request_id": "req_...",
    "cost_usd": 0.00042,
    "cache_hit": false
  }
}

Rate Limits

Requests are guarded by body-size, input-size, queued-request, inflight, and per-minute limits.

429 responsesBack off and retry after the retry-after value when present.
Retry safetyUse idempotency-key on retryable chat, embeddings, inference, and agent-turn calls.
Capacity pressure409 or 503 may be retryable when models are queued or temporarily unavailable.

Error Codes

Error bodies include a message, code, request id, retryability, and optional retry timing.

StatusCodeWhat to do
400bad_requestFix the JSON body, unsupported parameter, or validation error.
400context_length_exceededShorten input or choose a longer-context model.
401unauthorizedSet Authorization: Bearer $TERMINAILI_API_KEY or the x-api-key header.
401model_not_allowedUse a model allowed by the API key policy.
402payment_requiredAdd credit, lower max tokens, or choose a lower-cost model.
409policy_violationUse a model and route allowed by the API key policy.
409/503capacity_unavailableRetry safely with idempotency-key; include the request id for support.
429rate_limit_exceededBack off and honor retry-after when present.

Embeddings API

Create embedding vectors from a string or batch of strings.

POSThttps://api.terminaili.com/v1/embeddings
ParameterTypeRequiredDescription
modelstringRequiredPublic embedding-capable model id.
inputstring | string[]RequiredText or batch of text inputs to embed.
dimensionsintegerOptionalRequested embedding dimensions when supported by the selected model.
encoding_formatfloat | base64OptionalOpenAI-compatible embedding encoding format.
metadataobjectOptionalPublic request metadata for routing or reporting.
Embeddings
curl https://api.terminaili.com/v1/embeddings \
  -H "Authorization: Bearer $TERMINAILI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "terminaili/embed-balanced",
    "input": "Embed this sentence for retrieval."
  }'

Models

List, inspect, and choose public model ids without provider or route internals.

EndpointMethodUse
/v1/modelsGETList usable public models; pass include_unavailable=true for catalog visibility.
/v1/models/{model_id}GETRead one public model by id.
/v1/models/healthGETCheck public model readiness by capability.
/v1/model-recommendationsPOSTAsk for ranked model ids for a task.
List models
curl https://api.terminaili.com/v1/models

Status & Ready

Use /status for availability and /ready for setup checks.

GEThttps://api.terminaili.com/v1/status
GEThttps://api.terminaili.com/v1/ready
Status
curl https://api.terminaili.com/v1/status
Ready
curl https://api.terminaili.com/v1/ready

Usage

Read public-safe spend, request, and model usage summaries with the same API key.

EndpointMethodUse
/v1/usageGETRead usage summaries scoped to the API key.
/v1/usage/exportGETExport sanitized usage summaries.
/v1/account/meter-eventsGETRead account meter events.
/v1/account/meter-events/exportGETExport account meter events.
/v1/request-historyGETRead retained sanitized requests.
/v1/request-history/exportGETExport retained sanitized requests.
Usage summary
curl https://api.terminaili.com/v1/usage \
  -H "Authorization: Bearer $TERMINAILI_API_KEY"

Request History

List, export, replay, or annotate retained sanitized request history.

EndpointMethodUse
/v1/request-historyGETList retained sanitized request summaries.
/v1/request-history/{request_id}GETRead one retained request.
/v1/request-history/{request_id}/replayPOSTReplay a retained chat or embeddings request.
/v1/request-history/{request_id}/feedbackPOSTAttach quality feedback to a retained request.
Request history
curl "https://api.terminaili.com/v1/request-history?limit=25" \
  -H "Authorization: Bearer $TERMINAILI_API_KEY" \
  -H "Content-Type: application/json"

Solana RPC

Read plan metadata, inspect tested methods, and proxy JSON-RPC for mainnet or devnet.

EndpointMethodUse
/v1/solana-rpc/plansGETRead Solana RPC access plans.
/v1/solana-rpc/methodsGETRead tested upstream JSON-RPC methods.
/v1/solana-rpc/{network}POSTProxy JSON-RPC requests for mainnet or devnet.
Solana RPC
curl "https://api.terminaili.com/v1/solana-rpc/mainnet" \
  -H "Authorization: Bearer $TERMINAILI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getHealth"
  }'

Account API

Export meter events and manage provider credentials for external model provider keys.

EndpointMethodUse
/v1/account/meter-eventsGETList account meter events.
/v1/account/meter-events/exportGETExport account meter events.
/v1/account/provider-credentialsGET/POSTList or create provider credentials.
/v1/account/provider-credentials/{credential_id}PATCH/DELETEUpdate or delete one credential.
/v1/account/provider-credentials/{credential_id}/testGETRun a credential health check.
Provider credential test
curl "https://api.terminaili.com/v1/account/provider-credentials/$CREDENTIAL_ID/test" \
  -H "Authorization: Bearer $TERMINAILI_API_KEY"