Skip to content
lynxby

API reference · v1

The base URL is https://lynxby.com/api/v1. All execution endpoints require Authorization: Bearer <token>. Send Accept: application/json and Content-Type: application/json for JSON bodies. Tokens restrict scopes; their owner's group permissions must also allow the action.

Download OpenAPI 3.1 · Create a scoped token after signing in · Request a sandbox organisation

A sandbox token requires an organisation and an authorised account; there is no anonymous shared token. Set LYNXBY_TOKEN and LYNXBY_BASE_URL in the server environment when using @lynxby/sdk. Never put the token in browser code. List Tasks first and use an id returned by your own organisation.

TypeScript and Python clients, with install instructions and the token walkthrough: github.com/LynxbyAI/lynxby-sdk. Harnesses that speak MCP connect to https://lynxby.com/mcp instead; the client setup is in the MCP guide.

Endpoints and scopes

MethodPathPurposeScope
GET/meProbe a tokenknowledge.read
GET/api/v1/approvals/actionsList write actions waiting for a decisionrun.read
POST/api/v1/approvals/actions/{id}/approveApprove one write actionrun.execute
POST/api/v1/approvals/actions/{id}/rejectReject one write actionrun.execute
GET/api/v1/approvals/runsList runs waiting for a decisionrun.read
POST/api/v1/approvals/runs/{id}/approveApprove a parked run and start itrun.execute
POST/api/v1/approvals/runs/{id}/rejectReject a parked runrun.execute
POST/api/v1/apps/attachmentsStore files a helpdesk app backend downloadedassistant.execute
POST/api/v1/apps/jira/membershipCheck a Jira user for a Lynxby seatmember.read
POST/api/v1/apps/zendesk/attachmentsRead Zendesk ticket attachments for the appassistant.execute
GET/api/v1/assistantsList assistantsassistant.read
GET/api/v1/assistants/{id}Read one assistantassistant.read
POST/api/v1/assistants/{id}/messagesSend a message and get the answerassistant.execute
POST/api/v1/assistants/{id}/messages/streamStream a messageassistant.execute
GET/api/v1/budgetsList budgetsbudget.read
POST/api/v1/chat/completionsAn OpenAI-compatible chat completiongateway.invoke
GET/api/v1/invoicesList invoicesbilling.read
GET/api/v1/invoices/{id}Read one invoice and its feesbilling.read
GET/api/v1/invoices/{id}/pdfDownload an invoice PDFbilling.read
POST/api/v1/messagesAn Anthropic Messages callgateway.invoke
POST/api/v1/messages/count_tokensCount the tokens of a Messages requestgateway.invoke
GET/api/v1/modelsList the models this organisation may callgateway.invoke
GET/api/v1/openapi.jsonThe OpenAPI documentPublic
POST/api/v1/responsesAn OpenAI Responses callgateway.invoke
GET/api/v1/runsList runsrun.read
GET/api/v1/runs/{id}Read one run and its timelinerun.read
POST/api/v1/runs/{id}/retryRetry a run as a new recordrun.execute
GET/api/v1/sessionsList the actor's chat sessionsassistant.read
GET/api/v1/sessions/{session}/messagesList the messages in one sessionassistant.read
GET/api/v1/tasksList taskstask.read
GET/api/v1/tasks/{id}Read one task and its formtask.read
POST/api/v1/tasks/{id}/runsRun a tasktask.execute
POST/api/v1/tasks/{id}/runs/streamRun a task and stream the resulttask.execute
GET/api/v1/triggersList triggerstrigger.read
GET/api/v1/triggers/{id}Read one triggertrigger.read
POST/api/v1/triggers/{id}/runRun a trigger nowtrigger.execute
GET/api/v1/usageRead usage and costusage.read

Pagination

List endpoints take per_page (default 25, maximum 100) and an optional opaque cursor. Responses include data, next_cursor and has_more. Send the returned cursor unchanged for the next page; a null cursor marks the end. There is no total count.

Idempotency

Send an Idempotency-Key, a caller-chosen request identifier, on creating POSTs and streaming calls. Reuse it for retries. A stored result is replayed with Idempotency-Replayed: true. Keep keys unique across operations within the organisation. Concurrent requests using a fresh key can both execute; do not send retries in parallel.

Streaming events

POST to /assistants/{id}/messages/stream with {"message":"Your question"}, or /tasks/{id}/runs/stream with {"inputs":{}}. Both use text/event-stream; each event has an event name and a JSON data object.

event: start
data: {"model":"model-id","session_id":"session-id"}

event: delta
data: {"delta":"Part of the answer"}

event: done
data: {"session_id":"session-id","content":"The answer"}

Assistant streams emit start {model, session_id}, thinking {delta}, tool {tool}, delta {delta}, then done with the ordinary message response, or error {code, message}. Task streams emit start {model, task_id}, then done with the run response or error {code, message}. A replay emits the stored done result. The JSON document describes request fields for each operation.

Errors

JSON errors carry code, message and request_id; validation may add errors, and a missing scope adds scope. Keep the request id for support.

Rate limits and versioning

The implemented default is 60 requests per minute per token. An admin can set a token's ceiling; the code has no plan-specific API allowance. Responses report X-RateLimit-Limit and X-RateLimit-Remaining; a 429 reports Retry-After in seconds.

The current route namespace is /api/v1. There is no published deprecation notice period or support window yet; Sebastiaan must confirm those commitments before an integration relies on them.

Full OpenAPI document
{
    "openapi": "3.1.0",
    "info": {
        "title": "Lynxby API",
        "version": "1.0.0",
        "description": "The product API. Machine tokens from the organisation settings authenticate every call."
    },
    "servers": [
        {
            "url": "https://lynxby.com"
        }
    ],
    "tags": [
        {
            "name": "Assistants"
        },
        {
            "name": "Chat"
        },
        {
            "name": "Sessions"
        },
        {
            "name": "Tasks"
        },
        {
            "name": "Runs"
        },
        {
            "name": "Approvals"
        },
        {
            "name": "Triggers"
        },
        {
            "name": "Budgets"
        },
        {
            "name": "Usage"
        },
        {
            "name": "Invoices"
        },
        {
            "name": "Gateway"
        },
        {
            "name": "Docs"
        }
    ],
    "paths": {
        "/api/v1/approvals/actions": {
            "get": {
                "operationId": "api.v1.approvals.actions",
                "summary": "List write actions waiting for a decision",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "run.read"
            }
        },
        "/api/v1/approvals/actions/{id}/approve": {
            "post": {
                "operationId": "api.v1.approvals.actions.approve",
                "summary": "Approve one write action",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 200
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "run.execute"
            }
        },
        "/api/v1/approvals/actions/{id}/reject": {
            "post": {
                "operationId": "api.v1.approvals.actions.reject",
                "summary": "Reject one write action",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 500
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "run.execute"
            }
        },
        "/api/v1/approvals/runs": {
            "get": {
                "operationId": "api.v1.approvals.runs",
                "summary": "List runs waiting for a decision",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "run.read"
            }
        },
        "/api/v1/approvals/runs/{id}/approve": {
            "post": {
                "operationId": "api.v1.approvals.runs.approve",
                "summary": "Approve a parked run and start it",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 200,
                                        "description": "Why it was approved, kept on the run and in the ledger."
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "run.execute"
            }
        },
        "/api/v1/approvals/runs/{id}/reject": {
            "post": {
                "operationId": "api.v1.approvals.runs.reject",
                "summary": "Reject a parked run",
                "tags": [
                    "Approvals"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "maxLength": 500,
                                        "description": "Why it was rejected, kept on the run and in the ledger."
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "run.execute"
            }
        },
        "/api/v1/apps/attachments": {
            "post": {
                "operationId": "api.v1.apps.attachments",
                "summary": "Store files a helpdesk app backend downloaded",
                "tags": [
                    "Chat"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "For a helpdesk backend that already has the file, such as the Jira Service Desk app. Returns pending attachment ids for POST /assistants/{id}/messages. The body cap is 20 MB and each file is at most 5 MB.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assistant_id": {
                                        "type": "integer",
                                        "description": "The assistant the files will be sent to."
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "maxItems": 3,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "name": {
                                                    "type": "string",
                                                    "maxLength": 255
                                                },
                                                "mime": {
                                                    "type": "string",
                                                    "maxLength": 100
                                                },
                                                "content_base64": {
                                                    "type": "string",
                                                    "description": "The file bytes, at most 5 MB decoded."
                                                }
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "assistant_id",
                                    "attachments"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "assistant.execute"
            }
        },
        "/api/v1/apps/jira/membership": {
            "post": {
                "operationId": "api.v1.apps.jira.membership",
                "summary": "Check a Jira user for a Lynxby seat",
                "tags": [
                    "Integrations"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "Used by the Jira Service Desk app before a shared assistant token is allowed to answer. `member` says the address belongs to the organisation, `seat` says it is an active person rather than a service account, `can_execute` says that person may run an assistant, and `atlassian_connector` says the organisation has an enabled Jira, Confluence and Service Desk connector.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "description": "The Jira user email to check in the token's organisation."
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "member.read"
            }
        },
        "/api/v1/apps/zendesk/attachments": {
            "post": {
                "operationId": "api.v1.apps.zendesk.attachments",
                "summary": "Read Zendesk ticket attachments for the app",
                "tags": [
                    "Chat"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "For the Zendesk marketplace app. The agent email and API token travel in the X-Zendesk-Email and X-Zendesk-Token headers for this call; the endpoint downloads the files, returns pending attachment ids, and the app then sends them with POST /assistants/{id}/messages.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assistant_id": {
                                        "type": "integer",
                                        "description": "The assistant the files will be sent to."
                                    },
                                    "attachment_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "maxItems": 3,
                                        "description": "Zendesk attachment ids from the ticket comments."
                                    }
                                },
                                "required": [
                                    "assistant_id",
                                    "attachment_ids"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "assistant.execute"
            }
        },
        "/api/v1/assistants": {
            "get": {
                "operationId": "api.v1.assistants.index",
                "summary": "List assistants",
                "tags": [
                    "Assistants"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "assistant.read"
            }
        },
        "/api/v1/assistants/{id}": {
            "get": {
                "operationId": "api.v1.assistants.show",
                "summary": "Read one assistant",
                "tags": [
                    "Assistants"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "assistant.read"
            }
        },
        "/api/v1/assistants/{id}/messages": {
            "post": {
                "operationId": "api.v1.assistants.messages",
                "summary": "Send a message and get the answer",
                "tags": [
                    "Chat"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "maxLength": 4000,
                                        "description": "What you want to ask."
                                    },
                                    "session_id": {
                                        "type": "string",
                                        "maxLength": 64,
                                        "description": "Continue an earlier session by its id."
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "maxItems": 3,
                                        "description": "Pending attachment ids, for example from the Zendesk app endpoint."
                                    }
                                },
                                "required": [
                                    "message"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "assistant.execute"
            }
        },
        "/api/v1/assistants/{id}/messages/stream": {
            "post": {
                "operationId": "api.v1.assistants.messages.stream",
                "summary": "Stream a message",
                "tags": [
                    "Chat"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Server-sent events: start, thinking, delta, tool, done and error, the same events the chat screen reads.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "Server-sent events: start, thinking, delta, tool, done and error, the same events the chat screen reads.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "maxLength": 4000
                                    },
                                    "session_id": {
                                        "type": "string",
                                        "maxLength": 64
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "maxItems": 3
                                    }
                                },
                                "required": [
                                    "message"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "assistant.execute"
            }
        },
        "/api/v1/budgets": {
            "get": {
                "operationId": "api.v1.budgets.index",
                "summary": "List budgets",
                "tags": [
                    "Budgets"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "budget.read"
            }
        },
        "/api/v1/chat/completions": {
            "post": {
                "operationId": "api.v1.chat.completions",
                "summary": "An OpenAI-compatible chat completion",
                "tags": [
                    "Gateway"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "An unknown model is a 404 listing what this organisation may use. Errors are OpenAI-shaped: an `error` object with `message`, `type`, `param` and `code`. A stream ends with `data: [DONE]`.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "An unknown model is a 404 listing what this organisation may use. Errors are OpenAI-shaped: an `error` object with `message`, `type`, `param` and `code`. A stream ends with `data: [DONE]`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "A route slug or a catalogue model id from GET /api/v1/models."
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "The conversation so far, in the OpenAI message shape."
                                    },
                                    "stream": {
                                        "type": "boolean",
                                        "description": "Server-sent events instead of one object."
                                    },
                                    "stream_options": {
                                        "type": "object",
                                        "description": "Set include_usage to get a final chunk carrying the tokens."
                                    },
                                    "temperature": {
                                        "type": "number",
                                        "minimum": 0,
                                        "maximum": 2
                                    },
                                    "max_tokens": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "stop": {
                                        "type": [
                                            "string",
                                            "array"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "tool_choice": {
                                        "type": [
                                            "string",
                                            "object"
                                        ]
                                    }
                                },
                                "required": [
                                    "model",
                                    "messages"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "gateway.invoke"
            }
        },
        "/api/v1/invoices": {
            "get": {
                "operationId": "api.v1.invoices.index",
                "summary": "List invoices",
                "tags": [
                    "Invoices"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "The invoices FlexPrice has issued to this organisation. Filter with status when only finalized invoices are wanted.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "finalized",
                                "voided",
                                "skipped"
                            ]
                        }
                    }
                ],
                "x-scope": "billing.read"
            }
        },
        "/api/v1/invoices/{id}": {
            "get": {
                "operationId": "api.v1.invoices.show",
                "summary": "Read one invoice and its fees",
                "tags": [
                    "Invoices"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "billing.read"
            }
        },
        "/api/v1/invoices/{id}/pdf": {
            "get": {
                "operationId": "api.v1.invoices.pdf",
                "summary": "Download an invoice PDF",
                "tags": [
                    "Invoices"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns the PDF. A 202 means FlexPrice is still generating it; retry shortly.",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "Returns the PDF. A 202 means FlexPrice is still generating it; retry shortly.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "billing.read"
            }
        },
        "/api/v1/messages": {
            "post": {
                "operationId": "api.v1.messages",
                "summary": "An Anthropic Messages call",
                "tags": [
                    "Gateway"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Set the base URL to this server's `/api`, because an Anthropic client appends `/v1/messages` itself. The `anthropic-version` header is required and `anthropic-beta` is passed on. Only Claude models are served: anything else is a 400 before a provider is called. Errors are Anthropic-shaped: `{\"type\":\"error\",\"error\":{\"type\":\"...\",\"message\":\"...\"}}`.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "Set the base URL to this server's `/api`, because an Anthropic client appends `/v1/messages` itself. The `anthropic-version` header is required and `anthropic-beta` is passed on. Only Claude models are served: anything else is a 400 before a provider is called. Errors are Anthropic-shaped: `{\"type\":\"error\",\"error\":{\"type\":\"...\",\"message\":\"...\"}}`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "A Claude model id from GET /api/v1/models, or a route slug that resolves to one."
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "The conversation so far, in the Anthropic message shape, tool_use and tool_result blocks included."
                                    },
                                    "system": {
                                        "type": [
                                            "string",
                                            "array"
                                        ],
                                        "description": "A string, or text blocks that may carry cache_control."
                                    },
                                    "max_tokens": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "stream": {
                                        "type": "boolean",
                                        "description": "Anthropic server-sent events instead of one message object."
                                    },
                                    "temperature": {
                                        "type": "number",
                                        "minimum": 0,
                                        "maximum": 1
                                    },
                                    "stop_sequences": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "tool_choice": {
                                        "type": "object"
                                    },
                                    "thinking": {
                                        "type": "object"
                                    },
                                    "metadata": {
                                        "type": "object"
                                    }
                                },
                                "required": [
                                    "model",
                                    "messages",
                                    "max_tokens"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "gateway.invoke"
            }
        },
        "/api/v1/messages/count_tokens": {
            "post": {
                "operationId": "api.v1.messages.count_tokens",
                "summary": "Count the tokens of a Messages request",
                "tags": [
                    "Gateway"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "An estimate from the request text, answered without a provider call: `{\"input_tokens\": 1234}`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "The Claude model the request would use."
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "system": {
                                        "type": [
                                            "string",
                                            "array"
                                        ]
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "tool_choice": {
                                        "type": "object"
                                    },
                                    "thinking": {
                                        "type": "object"
                                    }
                                },
                                "required": [
                                    "model",
                                    "messages"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "gateway.invoke"
            }
        },
        "/api/v1/models": {
            "get": {
                "operationId": "api.v1.models",
                "summary": "List the models this organisation may call",
                "tags": [
                    "Gateway"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "An OpenAI-shaped list: a route answers to its slug, a catalogue model to its id.",
                "x-scope": "gateway.invoke"
            }
        },
        "/api/v1/openapi.json": {
            "get": {
                "operationId": "api.v1.openapi",
                "summary": "The OpenAPI document",
                "tags": [
                    "Docs"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/api/v1/responses": {
            "post": {
                "operationId": "api.v1.responses",
                "summary": "An OpenAI Responses call",
                "tags": [
                    "Gateway"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The shape Codex CLI speaks with `wire_api = \"responses\"`. An unknown model is a 404 listing what this organisation may use. Errors are OpenAI-shaped: an `error` object with `message`, `type`, `param` and `code`. A stream ends with `response.completed`.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "The shape Codex CLI speaks with `wire_api = \"responses\"`. An unknown model is a 404 listing what this organisation may use. Errors are OpenAI-shaped: an `error` object with `message`, `type`, `param` and `code`. A stream ends with `response.completed`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "A route slug or a catalogue model id from GET /api/v1/models."
                                    },
                                    "input": {
                                        "type": [
                                            "string",
                                            "array"
                                        ],
                                        "description": "A prompt string, or input items: messages, function_call, function_call_output."
                                    },
                                    "instructions": {
                                        "type": "string",
                                        "description": "A system message placed before the input."
                                    },
                                    "stream": {
                                        "type": "boolean",
                                        "description": "Responses server-sent events instead of one response object."
                                    },
                                    "temperature": {
                                        "type": "number",
                                        "minimum": 0,
                                        "maximum": 2
                                    },
                                    "max_output_tokens": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        },
                                        "description": "Function tools, declared flat as the Responses API does."
                                    },
                                    "tool_choice": {
                                        "type": [
                                            "string",
                                            "object"
                                        ]
                                    }
                                },
                                "required": [
                                    "model",
                                    "input"
                                ]
                            }
                        }
                    }
                },
                "x-scope": "gateway.invoke"
            }
        },
        "/api/v1/runs": {
            "get": {
                "operationId": "api.v1.runs.index",
                "summary": "List runs",
                "tags": [
                    "Runs"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "run.read"
            }
        },
        "/api/v1/runs/{id}": {
            "get": {
                "operationId": "api.v1.runs.show",
                "summary": "Read one run and its timeline",
                "tags": [
                    "Runs"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "run.read"
            }
        },
        "/api/v1/runs/{id}/retry": {
            "post": {
                "operationId": "api.v1.runs.retry",
                "summary": "Retry a run as a new record",
                "tags": [
                    "Runs"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "run.execute"
            }
        },
        "/api/v1/sessions": {
            "get": {
                "operationId": "api.v1.sessions.index",
                "summary": "List the actor's chat sessions",
                "tags": [
                    "Sessions"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "assistant.read"
            }
        },
        "/api/v1/sessions/{session}/messages": {
            "get": {
                "operationId": "api.v1.sessions.messages",
                "summary": "List the messages in one session",
                "tags": [
                    "Sessions"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "assistant.read"
            }
        },
        "/api/v1/tasks": {
            "get": {
                "operationId": "api.v1.tasks.index",
                "summary": "List tasks",
                "tags": [
                    "Tasks"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "task.read"
            }
        },
        "/api/v1/tasks/{id}": {
            "get": {
                "operationId": "api.v1.tasks.show",
                "summary": "Read one task and its form",
                "tags": [
                    "Tasks"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "task.read"
            }
        },
        "/api/v1/tasks/{id}/runs": {
            "post": {
                "operationId": "api.v1.tasks.runs",
                "summary": "Run a task",
                "tags": [
                    "Tasks"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inputs": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string",
                                            "maxLength": 20000
                                        },
                                        "description": "One value per form field."
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "task.execute"
            }
        },
        "/api/v1/tasks/{id}/runs/stream": {
            "post": {
                "operationId": "api.v1.tasks.runs.stream",
                "summary": "Run a task and stream the result",
                "tags": [
                    "Tasks"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Server-sent events: start, done and error.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "description": "Server-sent events: start, done and error.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inputs": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string",
                                            "maxLength": 20000
                                        }
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "task.execute"
            }
        },
        "/api/v1/triggers": {
            "get": {
                "operationId": "api.v1.triggers.index",
                "summary": "List triggers",
                "tags": [
                    "Triggers"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "The next_cursor of the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "x-scope": "trigger.read"
            }
        },
        "/api/v1/triggers/{id}": {
            "get": {
                "operationId": "api.v1.triggers.show",
                "summary": "Read one trigger",
                "tags": [
                    "Triggers"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-scope": "trigger.read"
            }
        },
        "/api/v1/triggers/{id}/run": {
            "post": {
                "operationId": "api.v1.triggers.run",
                "summary": "Run a trigger now",
                "tags": [
                    "Triggers"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "description": "A value the caller chooses. The same key returns the original answer, never a second run.",
                        "schema": {
                            "type": "string",
                            "maxLength": 120
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inputs": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string",
                                            "maxLength": 20000
                                        }
                                    }
                                },
                                "required": []
                            }
                        }
                    }
                },
                "x-scope": "trigger.execute"
            }
        },
        "/api/v1/usage": {
            "get": {
                "operationId": "api.v1.usage.index",
                "summary": "Read usage and cost",
                "tags": [
                    "Usage"
                ],
                "security": [
                    {
                        "bearerToken": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationFailed"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "x-scope": "usage.read"
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerToken": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "lynx_ token",
                "description": "A machine token minted in the organisation settings."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "code",
                    "message",
                    "request_id"
                ],
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "A machine code such as insufficient_scope or rate_limited."
                    },
                    "message": {
                        "type": "string"
                    },
                    "request_id": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Page": {
                "type": "object",
                "required": [
                    "data",
                    "next_cursor",
                    "has_more"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Run": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "task_id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "running",
                            "completed",
                            "failed",
                            "stopped",
                            "waiting_approval"
                        ]
                    },
                    "answer": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "model": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cost": {
                        "type": "number"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "The token is missing, expired or revoked.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The token is missing a scope this route needs.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "The resource does not exist in this organisation.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ValidationFailed": {
                "description": "The body or query is not valid.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Too many requests; retry after the Retry-After header.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        }
    }
}

Search all guides