Properties
| Name | Type | Description |
|---|---|---|
| id | string | Public ID of the generation |
| project_id | string | Public ID of the project |
| agent_id | string | Public ID of the agent that ran this generation |
| trace_id | string | Public ID of the trace this generation belongs to |
| initiator_generation_id | stringnull | Public ID of the generation that started this one: a sub-agent invocation, an approval continuation, a client-tool re-handoff or a memory-rule handler turn. Null for top-level generations. |
| chain_id | stringnull | Public ID of the continuation chain this generation belongs to. Set on every member of a chain — the continuations and the root they descend from — and null on a generation that is not part of one. |
| conversation_id | stringnull | Public ID of the conversation this turn served, or null for a generation started outside one — a direct call, a trigger, an orchestration node. This is the edge a memory assertion walks up to reach th |
| session_id | stringnull | Public ID of the session this generation was dispatched through, or null for a generation started outside one. This is the link a per-session cost reading follows; the session's own `usage` field repo |
| actor_id | stringnull | Public ID of the end-user actor the generation was attributed to, or null when none was. Copied onto the generation's usage event. |
| started_by_principal_type | object | Who started the generation |
| started_by_principal_id | stringnull | Public id of that principal: the user (`user_…`), or for API key auth the key itself (`key_…`), so the record names which key acted. |
| acted_as | objectnull | The principal the latest segment's tool calls ran as: the starter, or the agent when it runs under its own grant (`run_as: agent`). A caller who resumes the generation by submitting its tool outputs o |
| acts_for | objectnull | The opaque principal the starter acted for: the `principal` of the IAM token that started the generation, or the one an `On-Behalf-Of` assertion carried. `started_by_principal_*` names the key that mi |
| status | string | Lifecycle status of the generation |
| started_at | string | |
| completed_at | stringnull | When the generation reached a terminal state |
| last_activity_at | stringnull | |
| stop_reason | stringnull | Why the generation stopped. Either the model provider's own finish reason relayed unchanged ('stop', 'tool-calls', 'length', …) or one the platform names itself: 'max_steps' when the turn spent its wh |
| error | object | Why the generation failed: `AI_PROVIDER_ERROR` for an upstream provider failure, `GENERATION_FAILED` for any other failure of the turn. |
| action_id | stringnull | Logical action label supplied on the generate request. Recorded on the generation's usage event for per-action spend rollups. |
| trigger_id | stringnull | Trigger that initiated the generation, when applicable |
| orchestration_run_id | stringnull | Orchestration run that dispatched the generation. Null for a standalone generation. |
| node_id | stringnull | Node within `orchestration_run_id` that dispatched the generation. Together with the run it forms the usage event's replay identity. |
| node_attempt | integernull | The node's 1-based retry attempt, completing the run + node + attempt replay identity. A retried node produces one generation per attempt; this is what tells them apart. Null for a generation no orche |
| agent_version | integernull | Agent config version that served this generation, resolved by the served-version resolver (see [agent versions](/docs/modules/agents#versioning-and-staged-rollout)). |
| source | stringnull | What produced the generation besides production traffic: `eval` for an eval run, `decider` for a decider question. `null` for production traffic. |
| extraction | objectnull | What each [memory rule](/docs/modules/memory-rules) bound to `generations.completed` wrote for this turn, keyed by the rule's id — a store may have several rules, and one flat pair of counts could not |
| tool_surface | objectnull | What this turn's tool definitions cost to send — the one part of a prompt no provider reports and no caller can derive, since the tool block is a constant inside the reported totals and identical on e |
| retrieval | arraynull | What `knowledge_config` retrieval injected into this turn, in the order it was injected: which document, at which version, and which chunk, or which memory. Written by the server at turn start and nev |
| idempotency_key | stringnull | The deduplication key the generation was started under, unique within the project and claimed for as long as the generation record exists. Null for a generation started without one. |
| usage | object | What the turn cost: token counts and `cost_usd` for every event metered against this generation. Present on the single-generation read; omitted from the listing, where it would be a query per row. Nul |
| routing | objectnull | What the model route did for this generation. Present only when the agent resolves its model through a `model_route_id`. |
| metadata | object | Caller-owned key/value annotations, attached at create time (via the `metadata` field on the create-agent-generation request) or afterwards (via the update-generation request), and returned verbatim. |
| content_redacted_at | stringnull | When the generation's content was purged. Non-null means `metadata`, `error`, `extraction` and the internal recovery state have been cleared, while the usage/audit skeleton — ids, timestamps, status, |
| content_redacted_by_principal_type | object | Who purged the content: `user` or `api_key` for a purge request, `system` for the retention sweep and for content never stored under zero retention. |
| content_redacted_by_principal_id | stringnull | Public id of that principal — the API key's own id for key auth, so the record names which key acted. `retention_sweep` or `zero_retention` for `system`. |
| created_at | string | |
| updated_at | string |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/naturali-ai/json-schema/naturali-ai-generation-schema.json",
"title": "Generation",
"x-generated": "2026-11-19",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/naturali-ai-openapi.json#/components/schemas/Generation",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Public ID of the generation"
},
"project_id": {
"x-naturali-ref": "projects",
"type": "string",
"description": "Public ID of the project"
},
"agent_id": {
"x-naturali-ref": "agents",
"type": "string",
"description": "Public ID of the agent that ran this generation"
},
"trace_id": {
"x-naturali-ref": "traces",
"type": "string",
"description": "Public ID of the trace this generation belongs to"
},
"initiator_generation_id": {
"x-naturali-ref": "generations",
"type": [
"string",
"null"
],
"description": "Public ID of the generation that started this one: a sub-agent invocation, an approval continuation, a client-tool re-handoff or a memory-rule handler turn. Null for top-level generations.\n"
},
"chain_id": {
"x-naturali-ref": "chains",
"type": [
"string",
"null"
],
"description": "Public ID of the continuation chain this generation belongs to. Set on every member of a chain — the continuations and the root they descend from — and null on a generation that is not part of one.\n"
},
"conversation_id": {
"x-naturali-ref": "conversations",
"type": [
"string",
"null"
],
"description": "Public ID of the conversation this turn served, or null for a generation started outside one — a direct call, a trigger, an orchestration node. This is the edge a memory assertion walks up to reach the conversation a fact was learned in.\n"
},
"session_id": {
"x-naturali-ref": "sessions",
"type": [
"string",
"null"
],
"description": "Public ID of the session this generation was dispatched through, or null for a generation started outside one. This is the link a per-session cost reading follows; the session's own `usage` field reports the roll-up directly.\n"
},
"actor_id": {
"x-naturali-ref": "actors",
"type": [
"string",
"null"
],
"description": "Public ID of the end-user actor the generation was attributed to, or null when none was. Copied onto the generation's usage event.\n"
},
"started_by_principal_type": {
"nullable": true,
"allOf": [
{
"$ref": "#/$defs/PrincipalType"
}
],
"description": "Who started the generation"
},
"started_by_principal_id": {
"type": [
"string",
"null"
],
"description": "Public id of that principal: the user (`user_…`), or for API key auth the key itself (`key_…`), so the record names which key acted."
},
"acted_as": {
"type": [
"object",
"null"
],
"description": "The principal the latest segment's tool calls ran as: the starter, or the agent when it runs under its own grant (`run_as: agent`). A caller who resumes the generation by submitting its tool outputs only narrows what it may do. A tool call an approval held runs, once approved, as this principal. Null when the segment ran with no principal.",
"required": [
"principal_type",
"principal_id"
],
"properties": {
"principal_type": {
"$ref": "#/$defs/PrincipalType"
},
"principal_id": {
"type": "string"
}
}
},
"acts_for": {
"type": [
"object",
"null"
],
"description": "The opaque principal the starter acted for: the `principal` of the IAM token that started the generation, or the one an `On-Behalf-Of` assertion carried. `started_by_principal_*` names the key that minted the token. A resume keeps the starter's. Null when the starter named none.",
"required": [
"type",
"id"
],
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
},
"status": {
"type": "string",
"description": "Lifecycle status of the generation",
"enum": [
"running",
"requires_action",
"completed",
"failed"
]
},
"started_at": {
"type": "string",
"format": "date-time"
},
"completed_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "When the generation reached a terminal state"
},
"last_activity_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"stop_reason": {
"type": [
"string",
"null"
],
"description": "Why the generation stopped. Either the model provider's own finish reason relayed unchanged ('stop', 'tool-calls', 'length', …) or one the platform names itself: 'max_steps' when the turn spent its whole step budget on tool calls, 'depth_guard' when a nested call exceeded the call depth, 'chain_limit' when a continuation chain reached its generation budget, or 'error' when the turn failed.\n"
},
"error": {
"allOf": [
{
"$ref": "#/$defs/StoredError"
}
],
"nullable": true,
"description": "Why the generation failed: `AI_PROVIDER_ERROR` for an upstream provider failure, `GENERATION_FAILED` for any other failure of the turn."
},
"action_id": {
"type": [
"string",
"null"
],
"description": "Logical action label supplied on the generate request. Recorded on the generation's usage event for per-action spend rollups.\n"
},
"trigger_id": {
"x-naturali-ref": "triggers",
"type": [
"string",
"null"
],
"description": "Trigger that initiated the generation, when applicable"
},
"orchestration_run_id": {
"x-naturali-ref": "orchestration-runs",
"type": [
"string",
"null"
],
"description": "Orchestration run that dispatched the generation. Null for a standalone generation.\n"
},
"node_id": {
"type": [
"string",
"null"
],
"description": "Node within `orchestration_run_id` that dispatched the generation. Together with the run it forms the usage event's replay identity.\n"
},
"node_attempt": {
"type": [
"integer",
"null"
],
"description": "The node's 1-based retry attempt, completing the run + node + attempt replay identity. A retried node produces one generation per attempt; this is what tells them apart. Null for a generation no orchestration node dispatched.\n"
},
"agent_version": {
"type": [
"integer",
"null"
],
"description": "Agent config version that served this generation, resolved by the served-version resolver (see [agent versions](/docs/modules/agents#versioning-and-staged-rollout)).\n"
},
"source": {
"type": [
"string",
"null"
],
"description": "What produced the generation besides production traffic: `eval` for an eval run, `decider` for a decider question. `null` for production traffic.\n"
},
"extraction": {
"type": [
"object",
"null"
],
"description": "What each [memory rule](/docs/modules/memory-rules) bound to `generations.completed` wrote for this turn, keyed by the rule's id — a store may have several rules, and one flat pair of counts could not say which produced them. Absent when no rule fired. Rules bound to `conversation_messages.generated` are recorded only as memory assertions. The rows behind every count are listed by `GET /v1/projects/{project_id}/generations/{generation_id}/memory-assertions`, so the summary and what it summarizes can be reconciled.\n",
"additionalProperties": {
"type": "object",
"properties": {
"candidates": {
"type": "integer",
"description": "Number of candidates the rule's handler proposed"
},
"created": {
"type": "integer",
"description": "Number of new memories created"
},
"superseded": {
"type": "integer",
"description": "Number of candidates that restated a known fact that had changed, retiring the memory holding it\n"
},
"skipped": {
"type": "integer",
"description": "Number of candidates skipped (e.g. duplicates)"
}
}
}
},
"tool_surface": {
"type": [
"object",
"null"
],
"description": "What this turn's tool definitions cost to send — the one part of a prompt no provider reports and no caller can derive, since the tool block is a constant inside the reported totals and identical on every step.\n\nNull when the surface was never measured: a generation from before the field, or a path that resolves none. That is **not** what `tools: 0` means, which is a measured agent with nothing bound.\n\nNot a meter. `estimated_tokens` is an estimate and is never priced — `usage` and the usage events are the billing record.",
"properties": {
"tools": {
"type": "integer",
"description": "Tools resolved for the turn, before any per-step narrowing by `step_rules`."
},
"bytes": {
"type": "integer",
"description": "Serialized length of those definitions — name, description and input schema — in canonical JSON, not the provider's wire format. Exact, and comparable across providers, which is what makes two agents' surfaces worth comparing."
},
"estimated_tokens": {
"type": "integer",
"description": "`bytes` over a measured bytes-per-token ratio. An estimate, and named one."
}
}
},
"retrieval": {
"type": [
"array",
"null"
],
"description": "What `knowledge_config` retrieval injected into this turn, in the order it was injected: which document, at which version, and which chunk, or which memory. Written by the server at turn start and never writable; pointers only, never the text.\n\nNull when no retrieval ran — the agent has no `knowledge_config`, or the turn had neither a query nor a filter to search with. An empty array is a retrieval that ran and matched nothing.\n\nNot content: a content purge leaves it standing, and zero retention still writes it. `document_version` names an archived version, so the text the turn read stays readable after the document changes.",
"items": {
"oneOf": [
{
"$ref": "#/$defs/GenerationRetrievedDocument"
},
{
"$ref": "#/$defs/GenerationRetrievedMemory"
}
]
}
},
"idempotency_key": {
"type": [
"string",
"null"
],
"description": "The deduplication key the generation was started under, unique within the project and claimed for as long as the generation record exists. Null for a generation started without one."
},
"usage": {
"allOf": [
{
"$ref": "#/$defs/UsageTotals"
}
],
"nullable": true,
"description": "What the turn cost: token counts and `cost_usd` for every event metered against this generation. Present on the single-generation read; omitted from the listing, where it would be a query per row.\n\nNull when nothing has been metered yet — a turn still in flight, or one whose metering failed. A turn is metered once at the end, so this is one event's figures in the ordinary case."
},
"routing": {
"type": [
"object",
"null"
],
"description": "What the model route did for this generation. Present only when the agent resolves its model through a `model_route_id`.\n",
"properties": {
"route_id": {
"x-naturali-ref": "model-routes",
"type": "string",
"description": "The route that resolved the model"
},
"target_index": {
"type": [
"integer",
"null"
],
"description": "Position in the route's `targets` of the target that served the last LLM call; null when every attempt failed.\n"
},
"fallbacks": {
"type": "integer",
"description": "How many times the route moved past a target during this generation (cumulative across a multi-step run).\n"
},
"attempts": {
"type": "array",
"description": "Every attempt, in order, across every LLM call of the run. An attempt with no `error_class` succeeded.\n",
"items": {
"type": "object",
"properties": {
"target_index": {
"type": "integer"
},
"ai_provider_id": {
"x-naturali-ref": "ai-providers",
"type": "string"
},
"model": {
"type": "string"
},
"error_class": {
"type": "string",
"enum": [
"provider_error",
"timeout",
"rate_limited"
],
"description": "Why the attempt failed. Absent on the serving attempt, and absent on a deterministic failure (which fails the generation instead of failing over).\n"
}
}
}
}
}
},
"metadata": {
"description": "Caller-owned key/value annotations, attached at create time (via the `metadata` field on the create-agent-generation request) or afterwards (via the update-generation request), and returned verbatim. The server writes nothing here: every piece of state it owns — usage attribution, the served agent version, the route's record, the extraction summary, internal recovery state — is a field of its own, so no key written here can reach platform state. Keys are never transformed, and no key is reserved.\n",
"allOf": [
{
"$ref": "#/$defs/MetadataBag"
}
]
},
"content_redacted_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "When the generation's content was purged. Non-null means `metadata`, `error`, `extraction` and the internal recovery state have been cleared, while the usage/audit skeleton — ids, timestamps, status, stop reason and the attribution fields — is preserved.\n"
},
"content_redacted_by_principal_type": {
"nullable": true,
"allOf": [
{
"$ref": "#/$defs/PrincipalType"
}
],
"description": "Who purged the content: `user` or `api_key` for a purge request, `system` for the retention sweep and for content never stored under zero retention."
},
"content_redacted_by_principal_id": {
"type": [
"string",
"null"
],
"description": "Public id of that principal — the API key's own id for key auth, so the record names which key acted. `retention_sweep` or `zero_retention` for `system`."
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"$defs": {
"GenerationRetrievedDocument": {
"type": "object",
"required": [
"source_type",
"document_id",
"document_version",
"chunk_id",
"page",
"similarity_score"
],
"properties": {
"source_type": {
"type": "string",
"enum": [
"document"
]
},
"document_id": {
"x-naturali-ref": "documents",
"type": "string",
"description": "Public ID of the document the chunk belongs to"
},
"document_version": {
"type": [
"integer",
"null"
],
"description": "The document version the chunk was read from. Read it back with the document's versions to see the exact text the turn was given."
},
"chunk_id": {
"type": "string",
"description": "Public ID of the injected chunk. Stops resolving once the document is re-chunked; `document_version` is the durable pointer."
},
"page": {
"type": [
"integer",
"null"
],
"description": "Page within the source PDF (1-indexed). Null for plain text."
},
"similarity_score": {
"type": [
"number",
"null"
],
"description": "Raw cosine similarity (0–1) between the turn's query and the result. Null when the turn had no query, or the search answered from the lexical channel alone. The rank is the array order."
}
}
},
"GenerationRetrievedMemory": {
"type": "object",
"required": [
"source_type",
"memory_store_id",
"memory_id",
"similarity_score"
],
"properties": {
"source_type": {
"type": "string",
"enum": [
"memory"
]
},
"memory_store_id": {
"x-naturali-ref": "memory-stores",
"type": "string",
"description": "Public ID of the memory store the memory belongs to"
},
"memory_id": {
"type": "string",
"description": "Public ID of the injected memory"
},
"similarity_score": {
"type": [
"number",
"null"
],
"description": "Raw cosine similarity (0–1) between the turn's query and the result. Null when the turn had no query, or the search answered from the lexical channel alone. The rank is the array order."
}
}
},
"MetadataBag": {
"type": "object",
"description": "Caller-owned annotations on a resource, stored as the object they were written as: the types a value was written with are the types a read returns, so a filter can ask an ordering question about a number. Unlike other body fields, keys are stored and returned verbatim in the casing supplied — they are not converted between snake_case and camelCase.\n\nNo key is reserved, and that is the point: every piece of state the platform owns lives in its own typed column, so nothing written here reaches platform state. The platform never reads the bag — it is not an IAM context, not a policy input and not part of a prompt — which is what separates it from a tag bag."
},
"PrincipalType": {
"type": "string",
"enum": [
"user",
"api_key",
"agent",
"automation",
"approval",
"trigger",
"system",
"eval",
"decider",
"ingestion_rule",
"memory_rule",
"playbook_version"
],
"description": "What kind of principal acted. `user` and `api_key` are authenticated callers, and the id is the user's (`user_…`) or the key's own (`key_…`), so a record names which key acted rather than its owner. `agent` is an agent writing under its own identity (`agent_…`). `automation` is the task engine acting on a dispatch outcome and `approval` an approval resolution; neither carries an id. `trigger` is a trigger firing under its own `policy_ids` (`trg_…`). `system` is the platform itself, with an id naming the mechanism (`retention_sweep`, `zero_retention`). `eval`, `decider`, `ingestion_rule`, `memory_rule` and `playbook_version` are that resource's work running under its own `policy_ids` when nobody started it, the id its own."
},
"StoredError": {
"type": "object",
"description": "Why a resource's work failed, in the shape of an error response's `error`. Every `error` field a resource records carries it, so `code` can be read without first checking the type of `error`.",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"description": "A key from the server's ERROR_CODES registry, documented on the Error Codes page. `INTERNAL_ERROR`, with the message `Internal Server Error`, records an unexpected failure whose detail reaches the server log only."
},
"message": {
"type": "string"
},
"meta": {
"type": "object",
"additionalProperties": true,
"description": "The failure's own structured context, when it names any."
}
}
},
"UsageTotals": {
"type": "object",
"description": "Token counts and cost for one slice of the meter. Tokens and cost only: a `compute_second` or `gb_day` meter is reported by the aggregate's `components` array.\n\nThe three input dimensions partition the prompt — `input_tokens` = `uncached_input_tokens` + `cached_tokens` + `cache_write_tokens` — and are separate because they are separately priced. Note that the `input_tokens` **component** on a usage event is the uncached figure alone; here `input_tokens` is the whole prompt.\n",
"properties": {
"cost_usd": {
"type": [
"number",
"null"
],
"description": "Sum of priced component costs; null when nothing in the slice was priced. Always null at step altitude — the ledger prices one event per generation at write time, and a price read back per step would disagree with it after any price change."
},
"input_tokens": {
"type": "integer",
"description": "Full prompt tokens, reconstructed from the components."
},
"uncached_input_tokens": {
"type": "integer",
"description": "Prompt tokens priced at the plain input rate — the prompt minus cache reads and cache writes."
},
"output_tokens": {
"type": "integer"
},
"cached_tokens": {
"type": "integer",
"description": "Prompt tokens served from the provider's prompt cache."
},
"cache_write_tokens": {
"type": "integer",
"description": "Prompt tokens written into the provider's prompt cache."
},
"reasoning_tokens": {
"type": "integer",
"description": "A non-billable subset of `output_tokens`, reported where the provider breaks it out."
}
}
}
}
}
Work with this as data
Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for schemas
4 MCP tools reach this
find_json_schemasBrowse and filter every JSON Schema in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/naturali-ai-generation"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.