Skip to main content
API reference sections

Schema

InferenceAttempt

Type object

Shape

FieldTypeDescription
idrequiredInferenceAttemptId

InferenceAttemptId - a client-minted UUID v4, never derived from content or location.

operation_idrequiredstring
chat_idChatId or null
assistant_message_idMessageId or null
surfacerequiredAiSurface
intentrequiredAiIntent
providerrequiredAiProviderId

Extensible provider token such as openai, ollama, or koru.

requested_modelrequiredstring
resolved_modelstring or null
requested_reasoningrequiredReasoningChoice

A provider's reasoning setting - ai.db's nine-token CHECK.

effective_reasoningReasoningChoice or null
prompt_template_versionrequiredstring
statusrequiredAttemptStatus
queued_atrequiredTimestamp

Epoch milliseconds, UTC. Signed, so instants before 1970 are representable.

context_started_atTimestamp or null
context_completed_atTimestamp or null
provider_started_atTimestamp or null
first_token_atTimestamp or null
completed_atTimestamp or null
request_payload_bytesinteger (uint64, >= 0) or null
web_search_requestedboolean

Default false

web_search_callsinteger (uint32, >= 0)

Default 0

context_payload_bytesrequiredinteger (uint64, >= 0)
message_countrequiredinteger (uint32, >= 0)
context_document_countrequiredinteger (uint32, >= 0)
context_message_block_countrequiredinteger (uint32, >= 0)
usagerequiredAiUsage
context_used_tokensinteger (uint64, >= 0) or null

Latest active-context pair reported by this attempt's provider. It is distinct from response usage and absent for older attempts.

Default null

context_limit_tokensinteger (uint64, >= 0) or null

Default null

stop_reasonstring or null
error_classAiErrorClass or null
provider_response_idstring or null
Example
{
  "id": "00000000-0000-4000-8000-000000000000",
  "operation_id": "string",
  "chat_id": "00000000-0000-4000-8000-000000000000",
  "assistant_message_id": "00000000-0000-4000-8000-000000000000",
  "surface": "standalone",
  "intent": "chat",
  "provider": "string",
  "requested_model": "string",
  "resolved_model": "string",
  "requested_reasoning": "default",
  "effective_reasoning": "default",
  "prompt_template_version": "string",
  "status": "pending",
  "queued_at": 0,
  "context_started_at": 0,
  "context_completed_at": 0,
  "provider_started_at": 0,
  "first_token_at": 0,
  "completed_at": 0,
  "request_payload_bytes": 0,
  "web_search_requested": false,
  "web_search_calls": 0,
  "context_payload_bytes": 0,
  "message_count": 0,
  "context_document_count": 0,
  "context_message_block_count": 0,
  "usage": {
    "prompt_tokens": 0,
    "cached_prompt_tokens": 0,
    "completion_tokens": 0,
    "reasoning_tokens": 0,
    "total_tokens": 0,
    "source": "provider_reported"
  },
  "context_used_tokens": 0,
  "context_limit_tokens": 0,
  "stop_reason": "string",
  "error_class": "configuration",
  "provider_response_id": "string"
}

The contract has no example values, so example bodies are generated from each schema: every field is shown with a placeholder of its type.

Generated from contract version 1. Last updated .

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.