GenerationStreamFrame
One JSON payload carried in a `data:` line of the `text/event-stream` response of `POST /v1/generations` with `stream: true`. The stream is: one `init`, then for each variant `delta` frames followed by a `done` or `error` frame (frames of different variants interleave; match on `variant_index`), then the literal line `data: [DONE]`, which is not JSON. Em dashes are stripped from content. A `done` frame means the variant is saved and its credit deducted. Streamed drafts get no tell rewrite pass, so no `tells_fixed`.
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://artifacts.apis.io/scriptgrain-com/json-schema/scriptgrain-com-generation-stream-frame-schema.json",
"title": "GenerationStreamFrame",
"description": "One JSON payload carried in a `data:` line of the `text/event-stream` response of `POST /v1/generations`\nwith `stream: true`. The stream is: one `init`, then for each variant `delta` frames followed by a `done`\nor `error` frame (frames of different variants interleave; match on `variant_index`), then the literal\nline `data: [DONE]`, which is not JSON. Em dashes are stripped from content. A `done` frame means the\nvariant is saved and its credit deducted. Streamed drafts get no tell rewrite pass, so no `tells_fixed`.\n",
"x-generated": "2026-11-24",
"x-method": "derived",
"x-generator": "derive-json-schema.py",
"x-source": "openapi/scriptgrain-com-openapi.json#/components/schemas/GenerationStreamFrame",
"oneOf": [
{
"type": "object",
"title": "init",
"required": [
"type",
"variants"
],
"properties": {
"type": {
"type": "string",
"enum": [
"init"
]
},
"variants": {
"type": "array",
"items": {
"type": "object",
"required": [
"variant_index",
"variant_axis",
"generation_id"
],
"properties": {
"variant_index": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"variant_axis": {
"type": "string",
"enum": [
"standard",
"alternative_opening",
"oblique_angle"
]
},
"generation_id": {
"allOf": [
{
"$ref": "#/$defs/Uuid"
}
],
"description": "The row this variant is saved to."
}
}
}
}
}
},
{
"type": "object",
"title": "delta",
"required": [
"type",
"variant_index",
"generation_id",
"content"
],
"properties": {
"type": {
"type": "string",
"enum": [
"delta"
]
},
"variant_index": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"generation_id": {
"$ref": "#/$defs/Uuid"
},
"content": {
"type": "string",
"description": "The next piece of text for this variant."
}
}
},
{
"type": "object",
"title": "done",
"required": [
"type",
"variant_index",
"variant_axis",
"generation_id",
"status",
"word_count",
"word_count_target",
"within_tolerance",
"tolerance_pct",
"voice_match_score",
"voice_match_notes"
],
"properties": {
"type": {
"type": "string",
"enum": [
"done"
]
},
"variant_index": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"variant_axis": {
"type": "string",
"enum": [
"standard",
"alternative_opening",
"oblique_angle"
]
},
"generation_id": {
"$ref": "#/$defs/Uuid"
},
"status": {
"type": "string",
"enum": [
"drafted"
]
},
"word_count": {
"type": "integer"
},
"word_count_target": {
"type": [
"integer",
"null"
]
},
"within_tolerance": {
"type": [
"boolean",
"null"
]
},
"tolerance_pct": {
"type": "integer"
},
"voice_match_score": {
"type": [
"number",
"null"
]
},
"voice_match_notes": {
"type": [
"string",
"null"
]
}
}
},
{
"type": "object",
"title": "error",
"required": [
"type",
"variant_index",
"generation_id",
"message"
],
"description": "The variant produced no content after bounded retries; nothing is saved to it as content and no credit is charged.",
"properties": {
"type": {
"type": "string",
"enum": [
"error"
]
},
"variant_index": {
"type": "integer",
"minimum": 0,
"maximum": 2
},
"generation_id": {
"type": [
"string",
"null"
],
"format": "uuid"
},
"message": {
"type": "string"
}
}
}
],
"$defs": {
"Uuid": {
"type": "string",
"format": "uuid",
"description": "A UUID. Path ids that are not UUID-shaped never match a route (404 `not_found`)."
}
}
}
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
curl "https://apis.io/api/v1/json-schemas/scriptgrain-com-generation-stream-frame"
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.