{
    "openapi": "3.1.0",
    "info": {
        "title": "aicharged.io API",
        "version": "1.0.0",
        "summary": "REST twin of the aicharged.io MCP server — runs, tasks, tools, storage and integrations.",
        "description": "The aicharged.io REST API gives programs and AI agents the same tools, runs and history as the MCP server at https://aicharged.io/api/v1/mcp. Authenticate with `Authorization: Bearer <API_KEY>` (an `aic_…` key; create one at https://aicharged.io/admin/account/api-keys, with the CLI device login or by self-registration). Every tool call is recorded as a run. Onboarding for agents: https://aicharged.io/agent.md — index for language models: https://aicharged.io/llms.txt.",
        "termsOfService": "https://aicharged.io/terms",
        "contact": {
            "name": "aicharged.io",
            "url": "https://aicharged.io/contact"
        }
    },
    "servers": [
        {
            "url": "https://aicharged.io/api/v1",
            "description": "Production"
        }
    ],
    "externalDocs": {
        "description": "Setup guide for AI agents",
        "url": "https://aicharged.io/agent.md"
    },
    "security": [
        {
            "bearerAuth": []
        },
        {
            "oauth2": []
        }
    ],
    "tags": [
        {
            "name": "auth",
            "description": "Device login and agent self-registration (no key required)."
        },
        {
            "name": "discovery",
            "description": "Public, keyless documents — capability manifest, client recipes, MCP server card."
        },
        {
            "name": "account",
            "description": "Identity, usage analytics and prepaid credits."
        },
        {
            "name": "tools",
            "description": "The tool catalog and tool runs."
        },
        {
            "name": "tasks",
            "description": "Durable multi-step tasks (harness v1)."
        },
        {
            "name": "storage",
            "description": "Your S3-compatible buckets."
        },
        {
            "name": "integrations",
            "description": "Status and self-service of your own provider credentials (BYOK)."
        },
        {
            "name": "mcp",
            "description": "The MCP server (JSON-RPC 2.0 over HTTP POST)."
        }
    ],
    "paths": {
        "/auth/device/start": {
            "post": {
                "tags": [
                    "auth"
                ],
                "operationId": "deviceStart",
                "summary": "Start the device login of the aicharged CLI",
                "description": "Issues a device_code (kept by the CLI) and a user_code that the human approves at verification_uri in the browser. Poll /auth/device/token every `interval` seconds.",
                "security": [],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "scopes": {
                                        "description": "Scopes for the key (array or comma-separated string); default: full access.",
                                        "oneOf": [
                                            {
                                                "type": "array",
                                                "items": {
                                                    "$ref": "#/components/schemas/Scope"
                                                }
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ]
                                    },
                                    "client_name": {
                                        "type": "string",
                                        "maxLength": 128
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Device flow started.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceStart"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/auth/device/token": {
            "post": {
                "tags": [
                    "auth"
                ],
                "operationId": "deviceToken",
                "summary": "Poll the device login; returns the API key once approved",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "device_code"
                                ],
                                "properties": {
                                    "device_code": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Status of the flow; `token` is present exactly once, when status is approved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceToken"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown device_code.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "const": "not_found"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/auth/register": {
            "post": {
                "tags": [
                    "auth"
                ],
                "operationId": "register",
                "summary": "Self-registration — create an account and receive an API key at once",
                "description": "An agent creates its own account without a human: send an e-mail address and accept_terms=true and the answer already carries a working API key (shown exactly once) in the free tier with the default scopes. E-mail verification is optional — when mail can be delivered (verification.status = \"sent\") a 6-digit code goes to the address; POST it to /auth/register/verify to claim the address. Throttled per IP (5/hour, 20/day); disposable domains are refused; one account per e-mail (case-insensitive). The MCP twin is the account_register tool of POST /mcp/public.",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email",
                                    "accept_terms"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "accept_terms": {
                                        "type": "boolean",
                                        "const": true
                                    },
                                    "client": {
                                        "type": "string",
                                        "description": "Connect-catalog id of the client registering (e.g. claude-code). Analytics only."
                                    }
                                }
                            },
                            "examples": {
                                "agent": {
                                    "value": {
                                        "email": "agent@example.com",
                                        "accept_terms": true,
                                        "client": "claude-code"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Account created; the API key is shown exactly once.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RegistrationResult"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "registration_disabled — self-registration is switched off.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "email_taken — details.login_url points to the sign-in page.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_email, terms_required (details.terms_url / privacy_url) or disposable_domain.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/auth/register/verify": {
            "post": {
                "tags": [
                    "auth"
                ],
                "operationId": "registerVerify",
                "summary": "Self-registration — claim the e-mail with the code (optional)",
                "description": "Checks the 6-digit code mailed by /auth/register (15 minutes, 5 attempts). A correct code verifies the e-mail (account tier `verified`), REVOKES every older key of the account and returns a fresh one — whoever really reads the inbox ends up holding the only working key. The MCP twin is the account_verify tool of POST /mcp/public.",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email",
                                    "code"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "code": {
                                        "type": "string",
                                        "pattern": "^[0-9]{6}$"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "E-mail verified; the new API key is shown exactly once, older keys are revoked.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VerificationResult"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found — no self-registered account with this e-mail.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "already_verified.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "code_expired — ask for a new code with /auth/register/resend.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_code (details.attempts_left).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "too_many_attempts or rate_limited.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/register/resend": {
            "post": {
                "tags": [
                    "auth"
                ],
                "operationId": "registerResend",
                "summary": "Self-registration — send a new verification code",
                "description": "Always 202 — the answer never reveals whether the address has an account. `unavailable` means this server cannot deliver mail right now (the key from /auth/register keeps working).",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VerificationSent"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/capabilities": {
            "get": {
                "tags": [
                    "discovery"
                ],
                "operationId": "capabilities",
                "summary": "Capability manifest — free, credits or byok per tool",
                "description": "For every tool its access tiers, the providers it needs, whether a human must act first and the estimated cost; per provider whether an agent can configure it alone (self_service) or where a human grants access (authorize_url + authorize_via); the registration contract and the onboarding links. Also at /capabilities.json and as the MCP tools `capabilities` (public endpoint) / `account_capabilities`. Public and cached 5 minutes; with an OPTIONAL valid bearer key the answer adds `tier`, per-provider `configured` and an `account` section (then private, no-store). An invalid key is ignored, never 401.",
                "security": [],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Lang"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The manifest.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CapabilityManifest"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/connect/clients": {
            "get": {
                "tags": [
                    "discovery"
                ],
                "operationId": "connectClients",
                "summary": "Every client recipe (Claude Code, Codex, Cursor, …) as JSON",
                "description": "The connect catalog rendered with anonymous placeholders (<API_KEY>) in the request locale. Used by the aicharged CLI and external installers. Cached for one hour.",
                "security": [],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Lang"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The catalog.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectCatalog"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/connect/events": {
            "post": {
                "tags": [
                    "discovery"
                ],
                "operationId": "connectEvents",
                "summary": "Connect funnel beacon of the homepage and /connect pages (no PII)",
                "description": "Public, no key, no cookie; throttled 60/min. The body is JSON, sent as application/json or — by navigator.sendBeacon — as text/plain. Counts one event in the daily aggregate; nothing about the sender (IP, User-Agent, user) is stored. Requests that do not come from a browser are answered 204 but not counted.",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ConnectEvent"
                            }
                        },
                        "text/plain": {
                            "schema": {
                                "type": "string",
                                "description": "The same JSON object as a string (navigator.sendBeacon)."
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Recorded (or ignored for non-browser senders)."
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/mcp/server-card": {
            "get": {
                "tags": [
                    "discovery"
                ],
                "operationId": "mcpServerCard",
                "summary": "MCP server card (SEP-2127)",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Server card: remotes, auth and supported protocol versions (no tool list).",
                        "content": {
                            "application/mcp-server-card+json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "version",
                                        "remotes"
                                    ],
                                    "properties": {
                                        "$schema": {
                                            "type": "string"
                                        },
                                        "name": {
                                            "type": "string",
                                            "examples": [
                                                "io.aicharged/aicharged"
                                            ]
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "version": {
                                            "type": "string"
                                        },
                                        "websiteUrl": {
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "remotes": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string",
                                                        "const": "streamable-http"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "format": "uri"
                                                    },
                                                    "supportedProtocolVersions": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "_meta": {
                                            "type": "object",
                                            "additionalProperties": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me": {
            "get": {
                "tags": [
                    "account"
                ],
                "operationId": "me",
                "summary": "Who am I — the user and the key behind the bearer token",
                "responses": {
                    "200": {
                        "description": "Identity.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Me"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    }
                }
            }
        },
        "/usage": {
            "get": {
                "tags": [
                    "account"
                ],
                "operationId": "usage",
                "summary": "Personal usage analytics (runs and spend)",
                "description": "Spend counts completed runs only (cost_cents is the provider or infrastructure estimate in US cents). Default window is the current calendar month; group=month covers the last 12 months and group=day the last 30 days, both zero-filled. Scope runs.",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "group",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "provider",
                                "tool",
                                "pillar",
                                "source",
                                "month",
                                "day",
                                "api_key"
                            ],
                            "default": "provider"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Totals and grouped rows.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "group": {
                                            "type": "string"
                                        },
                                        "from": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "to": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "currency": {
                                            "type": "string",
                                            "const": "USD"
                                        },
                                        "totals": {
                                            "$ref": "#/components/schemas/UsageCounts"
                                        },
                                        "lifetime": {
                                            "type": "object",
                                            "properties": {
                                                "runs": {
                                                    "type": "integer"
                                                },
                                                "cost_cents": {
                                                    "type": "integer"
                                                }
                                            }
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "type": "object",
                                                        "properties": {
                                                            "key": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "$ref": "#/components/schemas/UsageCounts"
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/account/balance": {
            "get": {
                "tags": [
                    "account"
                ],
                "operationId": "accountBalance",
                "summary": "Prepaid credit balance",
                "description": "Prepaid credits pay for tools whose access is `credits` (they run on aicharged.io infrastructure). Only self-registered accounts are billed (`enforced`); accounts created by aicharged.io itself are never gated. Scope runs. MCP twin account_balance.",
                "responses": {
                    "200": {
                        "description": "Balance and the latest ledger entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "balance_cents": {
                                            "type": "integer"
                                        },
                                        "currency": {
                                            "type": "string"
                                        },
                                        "enforced": {
                                            "type": "boolean",
                                            "description": "Whether credits tools of this account are paid from (and blocked without) the balance."
                                        },
                                        "recent": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "delta_cents": {
                                                        "type": "integer"
                                                    },
                                                    "balance_after_cents": {
                                                        "type": "integer"
                                                    },
                                                    "reason": {
                                                        "type": "string"
                                                    },
                                                    "run_id": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        },
                                        "topup": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "method": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string",
                                                    "format": "uri"
                                                },
                                                "mcp_tool": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    }
                }
            }
        },
        "/account/topup": {
            "post": {
                "tags": [
                    "account"
                ],
                "operationId": "accountTopup",
                "summary": "Create a hosted checkout link to buy credits (hand it to a human)",
                "description": "Creates a Stripe Checkout session; the human pays in a browser and the webhook credits the account. Nothing is charged by this call. Needs a self-registered account with a verified e-mail. Without online payments configured the answer is 503 payments_unavailable with `manual` — the owner then tops up by hand (see the credits tier of GET /capabilities: payments = stripe | manual). Scope runs. MCP twin account_topup_link.",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "amount_cents": {
                                        "type": "integer",
                                        "minimum": 100,
                                        "maximum": 100000,
                                        "default": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Checkout link.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "checkout_url": {
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "amount_cents": {
                                            "type": "integer"
                                        },
                                        "currency": {
                                            "type": "string"
                                        },
                                        "expires_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "session_id": {
                                            "type": "string"
                                        },
                                        "hint": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/SelfServiceError"
                    },
                    "409": {
                        "description": "credits_not_required (account is not billed with credits) or email_unverified.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_amount (details.min / details.max).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "payment_provider_error — Stripe did not create the session (`manual` explains the fallback).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaymentsUnavailable"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "payments_unavailable — online payments are not configured; the owner tops up by hand.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaymentsUnavailable"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/account/login-link": {
            "post": {
                "tags": [
                    "account"
                ],
                "operationId": "accountLoginLink",
                "summary": "One-time browser login link for the human behind this key",
                "description": "Accounts registered by an agent have no password. This mints a 10-minute, single-use link that signs the human in on the web — for the dashboard and for OAuth consent pages (e.g. authorize_url of a provider in the capability manifest). Any active key works. Hand the link over privately; it is a secret. MCP twin: account_login_link.",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "next": {
                                        "type": "string",
                                        "description": "Relative /admin… or /oauth/authorize… path to open after the login (default /admin).",
                                        "examples": [
                                            "/admin/account/integrations/google/connect"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The login link.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoginLink"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "description": "account_suspended.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid_next — \"next\" is not a safe relative /admin… or /oauth/authorize… path.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        },
        "/tools": {
            "get": {
                "tags": [
                    "tools"
                ],
                "operationId": "listTools",
                "summary": "The curated tool catalog with input fields and cost estimates",
                "description": "The same catalog is embedded in this document as `x-aicharged-tools`.",
                "responses": {
                    "200": {
                        "description": "Tools.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Tool"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    }
                }
            }
        },
        "/runs": {
            "post": {
                "tags": [
                    "tools"
                ],
                "operationId": "createRun",
                "summary": "Run a tool",
                "description": "Starts one billed run of a catalog tool on your own provider credentials (or credits). Sync tools answer when done; async tools answer `queued` at once — poll GET /runs/{id}. Not idempotent — calling twice bills twice. Scope runs.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "tool"
                                ],
                                "properties": {
                                    "tool": {
                                        "type": "string",
                                        "description": "Tool slug from GET /tools, e.g. image.generate.",
                                        "examples": [
                                            "image.generate"
                                        ]
                                    },
                                    "input": {
                                        "type": "object",
                                        "additionalProperties": true,
                                        "examples": [
                                            {
                                                "prompt": "a lighthouse at dusk, watercolor"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The run.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Run"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "402": {
                        "description": "payment_required — a credits tool and the prepaid balance is too low (self-registered accounts). details carry topup_url; the run is kept as failed in the history.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SelfServiceError"
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "412": {
                        "description": "Provider not configured for this user — save credentials first.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            },
            "get": {
                "tags": [
                    "tools"
                ],
                "operationId": "listRuns",
                "summary": "Your runs, newest first",
                "description": "Keyset pagination with before_id (alias cursor) — follow next_cursor until it is null — or offset pagination with page. fields=summary returns light rows for list screens.",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "$ref": "#/components/schemas/RunStatus"
                        }
                    },
                    {
                        "name": "pillar",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "web",
                                "api",
                                "mcp",
                                "cli",
                                "scheduled"
                            ]
                        }
                    },
                    {
                        "name": "tool",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "before_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "fields",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "summary"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of runs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Run"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "next_cursor": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ]
                                        },
                                        "page": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    }
                }
            }
        },
        "/runs/{id}": {
            "get": {
                "tags": [
                    "tools"
                ],
                "operationId": "getRun",
                "summary": "One run with its lineage",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/RunId"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The run, its API key attribution and lineage (parent, root, task, children).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/Run"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "parent_run_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "root_run_id": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "children": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "additionalProperties": true
                                                    }
                                                },
                                                "tree_cost_cents": {
                                                    "type": "integer"
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/runs/{id}/media/{file}": {
            "get": {
                "tags": [
                    "tools"
                ],
                "operationId": "getRunMedia",
                "summary": "Download a generated media file of a run",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/RunId"
                    },
                    {
                        "name": "file",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9._-]+$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file.",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "contentMediaType": "application/octet-stream"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks": {
            "get": {
                "tags": [
                    "tasks"
                ],
                "operationId": "listTasks",
                "summary": "Your tasks",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "$ref": "#/components/schemas/TaskStatus"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_system",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of tasks.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tasks": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Task"
                                            }
                                        },
                                        "next_cursor": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    }
                }
            },
            "post": {
                "tags": [
                    "tasks"
                ],
                "operationId": "createTask",
                "summary": "Create a task from a plan",
                "description": "The body is a plan — title, goal, budget_cents, context and steps (kinds tool, human, wait, fanout, agent, noop) with deps between step keys and templates such as {{steps.<key>.output.<path>}}. Agent steps always wait for the owner's approval in the web UI. Scope runs.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskPlan"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The task.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "task": {
                                            "$ref": "#/components/schemas/Task"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks/{task}": {
            "get": {
                "tags": [
                    "tasks"
                ],
                "operationId": "getTask",
                "summary": "One task with its steps and recent events",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TaskUuid"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The task.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "task": {
                                            "$ref": "#/components/schemas/Task"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks/{task}/events": {
            "get": {
                "tags": [
                    "tasks"
                ],
                "operationId": "taskEvents",
                "summary": "Task events — Server-Sent Events, or a JSON page with format=json",
                "description": "SSE stream: a `snapshot` event, then every task event as `id`/`event`/`data`, a ping comment every 15 s and a close after about 55 s — reconnect with Last-Event-ID. format=json returns one page instead.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TaskUuid"
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "json",
                                "poll"
                            ]
                        }
                    },
                    {
                        "name": "Last-Event-ID",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event stream or page.",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/TaskEvent"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "last_event_id": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ]
                                        },
                                        "task_status": {
                                            "$ref": "#/components/schemas/TaskStatus"
                                        },
                                        "blocked_reason": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks/{task}/approve": {
            "post": {
                "tags": [
                    "tasks"
                ],
                "operationId": "approveTask",
                "summary": "Approve a waiting human step",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TaskUuid"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/TaskDecision"
                },
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/TaskDecided"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "description": "This step needs the owner's click in the web UI (code web_approval_required).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string"
                                        },
                                        "code": {
                                            "type": "string",
                                            "const": "web_approval_required"
                                        },
                                        "approve_url": {
                                            "type": "string",
                                            "format": "uri"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks/{task}/reject": {
            "post": {
                "tags": [
                    "tasks"
                ],
                "operationId": "rejectTask",
                "summary": "Reject a waiting human step",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TaskUuid"
                    }
                ],
                "requestBody": {
                    "$ref": "#/components/requestBodies/TaskDecision"
                },
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/TaskDecided"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/tasks/{task}/cancel": {
            "post": {
                "tags": [
                    "tasks"
                ],
                "operationId": "cancelTask",
                "summary": "Cancel a task",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TaskUuid"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The cancelled task.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "task": {
                                            "$ref": "#/components/schemas/Task"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/storage/providers": {
            "get": {
                "tags": [
                    "storage"
                ],
                "operationId": "storageProviders",
                "summary": "Your configured buckets",
                "description": "Scope storage.",
                "responses": {
                    "200": {
                        "description": "Configured providers.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "additionalProperties": true
                                            }
                                        },
                                        "capabilities": {
                                            "type": "object",
                                            "additionalProperties": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    }
                }
            }
        },
        "/storage/{provider}/list": {
            "get": {
                "tags": [
                    "storage"
                ],
                "operationId": "storageList",
                "summary": "List objects under a prefix",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/StorageProvider"
                    },
                    {
                        "name": "prefix",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "recursive",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "0",
                                "1"
                            ],
                            "default": "1"
                        }
                    },
                    {
                        "name": "max",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 10000
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Entries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "provider": {
                                            "type": "string"
                                        },
                                        "prefix": {
                                            "type": "string"
                                        },
                                        "recursive": {
                                            "type": "boolean"
                                        },
                                        "entries": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/StorageEntry"
                                            }
                                        },
                                        "count": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "502": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/storage/{provider}/download": {
            "get": {
                "tags": [
                    "storage"
                ],
                "operationId": "storageDownload",
                "summary": "Download one object",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/StorageProvider"
                    },
                    {
                        "$ref": "#/components/parameters/StoragePath"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The object bytes.",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "contentMediaType": "application/octet-stream"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/storage/{provider}/object": {
            "put": {
                "tags": [
                    "storage"
                ],
                "operationId": "storagePut",
                "summary": "Upload (create or replace) one object — raw bytes in the body",
                "description": "Streams the request body into the bucket at `path`. Conditional writes: If-None-Match '*' creates only, If-Match <etag> replaces only that version (412 otherwise).",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/StorageProvider"
                    },
                    {
                        "$ref": "#/components/parameters/StoragePath"
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-None-Match",
                        "in": "header",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/octet-stream": {
                            "schema": {
                                "type": "string",
                                "contentMediaType": "application/octet-stream"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Stored.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "stored": {
                                            "type": "boolean"
                                        },
                                        "path": {
                                            "type": "string"
                                        },
                                        "bytes": {
                                            "type": "integer"
                                        },
                                        "etag": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "size": {
                                            "type": "integer"
                                        },
                                        "modified": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "412": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "tags": [
                    "storage"
                ],
                "operationId": "storageDelete",
                "summary": "Delete one object (destructive)",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/StorageProvider"
                    },
                    {
                        "$ref": "#/components/parameters/StoragePath"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "412": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/integrations": {
            "get": {
                "tags": [
                    "integrations"
                ],
                "operationId": "integrationsStatus",
                "summary": "Status of every provider integration (never secrets)",
                "description": "Scope runs. Editing happens with PUT /integrations/{provider} or on the web (manage_url).",
                "responses": {
                    "200": {
                        "description": "Providers.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/IntegrationStatus"
                                            }
                                        },
                                        "count": {
                                            "type": "integer"
                                        },
                                        "configured_count": {
                                            "type": "integer"
                                        },
                                        "manage_url": {
                                            "type": "string",
                                            "format": "uri"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    }
                }
            }
        },
        "/integrations/providers": {
            "get": {
                "tags": [
                    "integrations"
                ],
                "operationId": "integrationProviders",
                "summary": "Providers an agent can configure, with their credential fields and your status",
                "description": "Every configurable provider with its credential fields, self_service flag and — for OAuth / chat-grant providers — authorize_url, authorize_via and human_required_reason; plus `status`, the caller's own saved credentials (masked, never values). Scope integrations. MCP twin: integrations_list.",
                "responses": {
                    "200": {
                        "description": "Providers and the caller's status.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/IntegrationProvider"
                                            }
                                        },
                                        "status": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/IntegrationCredentialStatus"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    }
                }
            }
        },
        "/integrations/{provider}": {
            "put": {
                "tags": [
                    "integrations"
                ],
                "operationId": "integrationSet",
                "summary": "Save your own credential for a provider (BYOK)",
                "description": "Create or replace (field-merge) your credential; stored encrypted per account, never returned (only masked). Field names come from GET /integrations/providers; a flat body {\"api_key\": \"…\"} is accepted too. Saving resets the provider's circuit breaker. OAuth / chat-grant providers (Gmail, X, Google Drive, …) answer 409 human_required with details.authorize_url for the human (open it through POST /account/login-link); managed providers answer 409 not_self_service. Scope integrations. MCP twin: integrations_set.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IntegrationProviderKey"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "credentials"
                                ],
                                "properties": {
                                    "credentials": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string"
                                        },
                                        "examples": [
                                            {
                                                "api_key": "<FAL_KEY>"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Saved.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "key": {
                                            "type": "string"
                                        },
                                        "configured": {
                                            "type": "boolean",
                                            "const": true
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "masked": {
                                            "type": "object",
                                            "additionalProperties": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/SelfServiceError"
                    },
                    "409": {
                        "$ref": "#/components/responses/SelfServiceError"
                    },
                    "422": {
                        "$ref": "#/components/responses/SelfServiceError"
                    }
                }
            },
            "delete": {
                "tags": [
                    "integrations"
                ],
                "operationId": "integrationRemove",
                "summary": "Remove your credential for a provider",
                "description": "Scope integrations. `removed` is false when nothing was saved. MCP twin integrations_remove.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IntegrationProviderKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Removed (or nothing to remove).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "key": {
                                            "type": "string"
                                        },
                                        "removed": {
                                            "type": "boolean"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/SelfServiceError"
                    },
                    "409": {
                        "$ref": "#/components/responses/SelfServiceError"
                    }
                }
            }
        },
        "/integrations/{provider}/test": {
            "post": {
                "tags": [
                    "integrations"
                ],
                "operationId": "integrationTest",
                "summary": "Live check of the saved credential (cheap, not billed)",
                "description": "A non-billed live call with your saved credential; `ok:false` + message when the provider rejects it. Nothing saved → 409 provider_not_configured (details.setup says how to save one). Scope integrations. MCP twin integrations_test.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/IntegrationProviderKey"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Result.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "key": {
                                            "type": "string"
                                        },
                                        "ok": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/SelfServiceError"
                    },
                    "409": {
                        "$ref": "#/components/responses/SelfServiceError"
                    }
                }
            }
        },
        "/mcp": {
            "post": {
                "tags": [
                    "mcp"
                ],
                "operationId": "mcp",
                "summary": "MCP server — one JSON-RPC 2.0 message per POST",
                "description": "Streamable HTTP transport, stateless, single messages (no batches). Dual-era: the 2026-07-28 revision (server/discover, required Mcp-Method / Mcp-Name headers, no initialize handshake) and the legacy revisions 2025-11-25, 2025-06-18 and 2025-03-26 (initialize → notifications/initialized). Methods include initialize, server/discover, ping, tools/list and tools/call; see the MCP specification and the tool annotations (readOnlyHint, destructiveHint, idempotentHint) plus `_meta[\"io.aicharged/access\"]` (tier, providers, self_service). Without a key the server answers 401 with `WWW-Authenticate: Bearer resource_metadata=\"…\"`; an OAuth token without the needed scope gets 403 insufficient_scope.",
                "parameters": [
                    {
                        "name": "MCP-Protocol-Version",
                        "in": "header",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "2026-07-28",
                                "2025-11-25",
                                "2025-06-18",
                                "2025-03-26"
                            ],
                            "examples": [
                                "2026-07-28"
                            ]
                        }
                    },
                    {
                        "name": "Mcp-Method",
                        "in": "header",
                        "description": "Required with MCP-Protocol-Version 2026-07-28 — the JSON-RPC method of the body.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Mcp-Name",
                        "in": "header",
                        "description": "Required with 2026-07-28 for tools/call — the tool name of the body.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/JsonRpcRequest"
                            },
                            "examples": {
                                "toolsList": {
                                    "value": {
                                        "jsonrpc": "2.0",
                                        "id": 1,
                                        "method": "tools/list"
                                    }
                                },
                                "toolsCall": {
                                    "value": {
                                        "jsonrpc": "2.0",
                                        "id": 2,
                                        "method": "tools/call",
                                        "params": {
                                            "name": "list_runs",
                                            "arguments": {
                                                "limit": 5
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON-RPC response (result or error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/JsonRpcResponse"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Notification accepted (no body)."
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthenticated"
                    }
                }
            },
            "get": {
                "tags": [
                    "mcp"
                ],
                "operationId": "mcpGet",
                "summary": "Not supported — the transport is POST-only",
                "responses": {
                    "405": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/mcp/public": {
            "post": {
                "tags": [
                    "mcp"
                ],
                "operationId": "mcpPublic",
                "summary": "Public MCP endpoint — no key",
                "description": "The same dual-era MCP transport as /mcp without any key, throttled 60/min, never billed. Methods: initialize, notifications/*, ping, server/discover, tools/list, tools/call. Eight tools: search, fetch (catalog + public docs), models_search, models_get (model catalog), capabilities (the capability manifest), connect_clients (client recipes), account_register (self-registration → an API key at once, same rules as POST /auth/register) and account_verify (claim the e-mail with the code). Every other tool answers a JSON-RPC error naming /mcp and the key it needs.",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/JsonRpcRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON-RPC response.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/JsonRpcResponse"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "aic_…",
                "description": "API key in the Authorization header (never in a URL). Create one at https://aicharged.io/admin/account/api-keys, with `aicharged setup` (device login) or by self-registration. Keys carry scopes; a missing scope answers 403."
            },
            "oauth2": {
                "type": "oauth2",
                "description": "OAuth 2.1 authorization code with PKCE (S256 only) and rotating refresh tokens, for clients that cannot send a static key (ChatGPT). Discovery: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource.",
                "x-code-challenge-methods": [
                    "S256"
                ],
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://aicharged.io/oauth/authorize",
                        "tokenUrl": "https://aicharged.io/oauth/token",
                        "refreshUrl": "https://aicharged.io/oauth/token",
                        "scopes": {
                            "runs": "Run AI tools and read your runs.",
                            "storage": "Read and write your buckets.",
                            "gmail": "Search, read, send and label your connected mailbox.",
                            "vast": "Search, rent and destroy Vast.ai GPU instances.",
                            "projects": "Read your projects, journal and agent sessions.",
                            "projects_write": "Write files in projects you granted (explicit only).",
                            "questionnaires": "Manage your questionnaires.",
                            "leads": "Read lead-generation data.",
                            "leads_write": "Write lead-generation data (explicit only).",
                            "voice": "Voice sessions and voice agents.",
                            "servers": "Your servers (Hetzner) and machine actions.",
                            "time": "Time items and views.",
                            "ui": "Adaptive UI profile and proposals.",
                            "integrations": "Configure your own provider credentials."
                        }
                    }
                }
            }
        },
        "parameters": {
            "Lang": {
                "name": "lang",
                "in": "query",
                "description": "One of the 30 supported locale codes; otherwise Accept-Language, then en.",
                "schema": {
                    "type": "string"
                }
            },
            "RunId": {
                "name": "id",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "integer"
                }
            },
            "TaskUuid": {
                "name": "task",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "string",
                    "format": "uuid"
                }
            },
            "StorageProvider": {
                "name": "provider",
                "in": "path",
                "required": true,
                "schema": {
                    "type": "string",
                    "enum": [
                        "r2",
                        "aws_s3",
                        "backblaze_b2",
                        "wasabi",
                        "do_spaces",
                        "minio"
                    ]
                }
            },
            "StoragePath": {
                "name": "path",
                "in": "query",
                "required": true,
                "schema": {
                    "type": "string"
                }
            },
            "IntegrationProviderKey": {
                "name": "provider",
                "in": "path",
                "required": true,
                "description": "Provider key from GET /integrations/providers (e.g. fal, openrouter, replicate).",
                "schema": {
                    "type": "string",
                    "pattern": "^[a-z0-9_]+$"
                }
            }
        },
        "requestBodies": {
            "TaskDecision": {
                "required": false,
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "step": {
                                    "type": "string",
                                    "maxLength": 64
                                },
                                "note": {
                                    "type": "string",
                                    "maxLength": 2000
                                }
                            }
                        }
                    }
                }
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "Missing or invalid key. The WWW-Authenticate header carries resource_metadata (RFC 9728).",
                "headers": {
                    "WWW-Authenticate": {
                        "schema": {
                            "type": "string",
                            "examples": [
                                "Bearer resource_metadata=\"https://aicharged.io/.well-known/oauth-protected-resource\", scope=\"runs\""
                            ]
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "string"
                                },
                                "docs": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "register": {
                                    "type": "string",
                                    "format": "uri"
                                }
                            }
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The key lacks the required scope.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error": {
                "description": "Error.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "Invalid input.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string"
                                },
                                "errors": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "TooManyRequests": {
                "description": "Throttled — retry after the Retry-After header."
            },
            "SelfServiceError": {
                "description": "Self-service error with a stable `error` code — unknown_provider (404), human_required (409, OAuth / chat-grant provider: details.authorize_url, details.authorize_via), not_self_service (409, managed provider — nothing to configure), provider_not_configured (409, details.setup), invalid_credentials (422, details.expected).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/SelfServiceError"
                        }
                    }
                }
            },
            "TaskDecided": {
                "description": "The decision and the updated task.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "decided": {
                                    "type": "object",
                                    "properties": {
                                        "step_key": {
                                            "type": "string"
                                        },
                                        "approved": {
                                            "type": "boolean"
                                        }
                                    }
                                },
                                "task": {
                                    "$ref": "#/components/schemas/Task"
                                }
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "Scope": {
                "type": "string",
                "description": "API key scope (see components.securitySchemes.oauth2 for the full list); `*` = full access."
            },
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string"
                    }
                }
            },
            "DeviceStart": {
                "type": "object",
                "required": [
                    "device_code",
                    "user_code",
                    "verification_uri",
                    "expires_in",
                    "interval"
                ],
                "properties": {
                    "device_code": {
                        "type": "string"
                    },
                    "user_code": {
                        "type": "string",
                        "examples": [
                            "WDJB-MZHN"
                        ]
                    },
                    "verification_uri": {
                        "type": "string",
                        "format": "uri"
                    },
                    "verification_uri_complete": {
                        "type": "string",
                        "format": "uri"
                    },
                    "expires_in": {
                        "type": "integer"
                    },
                    "interval": {
                        "type": "integer"
                    }
                }
            },
            "DeviceToken": {
                "type": "object",
                "required": [
                    "status"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "approved",
                            "denied",
                            "expired",
                            "already_issued"
                        ]
                    },
                    "token": {
                        "type": "string",
                        "description": "The API key (only when status is approved — shown once)."
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "name": {
                        "type": "string"
                    }
                }
            },
            "SelfServiceError": {
                "type": "object",
                "required": [
                    "error",
                    "message"
                ],
                "properties": {
                    "error": {
                        "type": "string",
                        "description": "Stable machine code (e.g. email_taken, human_required, not_self_service)."
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable, in the request locale."
                    },
                    "details": {
                        "type": "object",
                        "additionalProperties": true
                    }
                }
            },
            "VerificationSent": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "verification_sent",
                            "unavailable"
                        ]
                    },
                    "expires_in": {
                        "type": "integer",
                        "description": "Seconds the code stays valid (absent when mail is unavailable)."
                    }
                }
            },
            "RegistrationResult": {
                "type": "object",
                "required": [
                    "status",
                    "api_key",
                    "user_id",
                    "scopes",
                    "tier",
                    "verified",
                    "verification"
                ],
                "properties": {
                    "status": {
                        "type": "string",
                        "const": "registered"
                    },
                    "api_key": {
                        "type": "string",
                        "description": "The new key (aic_…), shown exactly once."
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "examples": [
                            [
                                "runs",
                                "storage",
                                "integrations"
                            ]
                        ]
                    },
                    "tier": {
                        "type": "string",
                        "const": "free"
                    },
                    "verified": {
                        "type": "boolean",
                        "const": false
                    },
                    "verification": {
                        "type": "object",
                        "properties": {
                            "method": {
                                "type": "string",
                                "const": "email_code"
                            },
                            "status": {
                                "type": "string",
                                "enum": [
                                    "sent",
                                    "unavailable"
                                ]
                            },
                            "expires_in": {
                                "type": "integer"
                            }
                        }
                    },
                    "capabilities_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "terms_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "privacy_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "next": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "VerificationResult": {
                "type": "object",
                "required": [
                    "verified",
                    "api_key",
                    "revoked_keys"
                ],
                "properties": {
                    "verified": {
                        "type": "boolean",
                        "const": true
                    },
                    "api_key": {
                        "type": "string",
                        "description": "A fresh key (aic_…), shown exactly once; every older key of the account is revoked."
                    },
                    "revoked_keys": {
                        "type": "integer"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "tier": {
                        "type": "string",
                        "const": "verified"
                    },
                    "next": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "PaymentsUnavailable": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "enum": [
                            "payments_unavailable",
                            "payment_provider_error"
                        ]
                    },
                    "message": {
                        "type": "string"
                    },
                    "details": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "manual": {
                        "type": "string",
                        "description": "How to get credit without online payment (the owner adds it by hand)."
                    }
                }
            },
            "LoginLink": {
                "type": "object",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "expires_in": {
                        "type": "integer",
                        "const": 600
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "next": {
                        "type": "string"
                    },
                    "single_use": {
                        "type": "boolean",
                        "const": true
                    }
                }
            },
            "ConnectEvent": {
                "type": "object",
                "required": [
                    "event",
                    "client"
                ],
                "properties": {
                    "event": {
                        "type": "string",
                        "enum": [
                            "copy",
                            "deeplink",
                            "open_in",
                            "pill"
                        ]
                    },
                    "client": {
                        "type": "string",
                        "description": "A connect-catalog client id (GET /connect/clients)."
                    },
                    "item": {
                        "type": "string",
                        "description": "copy → a snippet id of that client or install | endpoint | prompt | markdown | link | register; deeplink → a deeplink type; open_in → prompt; pill → more."
                    }
                }
            },
            "CapabilityManifest": {
                "type": "object",
                "properties": {
                    "version": {
                        "type": "string"
                    },
                    "tiers": {
                        "type": "object",
                        "description": "free | credits | byok — title, description, quota (quota_status), credits currency / topup_url / status, byok integrations_url.",
                        "additionalProperties": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "account_tiers": {
                        "type": "object",
                        "description": "owner | free | verified — what each account tier may do.",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "providers": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "object",
                            "properties": {
                                "label": {
                                    "type": "string"
                                },
                                "kind": {
                                    "type": "string"
                                },
                                "self_service": {
                                    "type": "boolean"
                                },
                                "managed": {
                                    "type": "boolean"
                                },
                                "available": {
                                    "type": "boolean"
                                },
                                "fields": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "additionalProperties": true
                                    }
                                },
                                "signup_url": {
                                    "type": "string"
                                },
                                "key_format": {
                                    "type": "string"
                                },
                                "docs_url": {
                                    "type": "string"
                                },
                                "pricing_url": {
                                    "type": "string"
                                },
                                "authorize_url": {
                                    "type": "string"
                                },
                                "authorize_via": {
                                    "type": "string",
                                    "description": "How an agent opens authorize_url for its human (a login-link call)."
                                },
                                "human_required_reason": {
                                    "type": "string"
                                },
                                "optional_slot_of": {
                                    "type": "string"
                                },
                                "configured": {
                                    "type": "boolean",
                                    "description": "Only with a bearer key — whether the caller saved this provider."
                                }
                            }
                        }
                    },
                    "tools": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "slug": {
                                    "type": "string"
                                },
                                "mcp_name": {
                                    "type": "string"
                                },
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "catalog",
                                        "mcp"
                                    ]
                                },
                                "family": {
                                    "type": "string"
                                },
                                "pillar": {
                                    "type": "string"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "mode": {
                                    "type": "string"
                                },
                                "scope": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "access": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "enum": [
                                            "free",
                                            "credits",
                                            "byok"
                                        ]
                                    }
                                },
                                "providers": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "any_provider": {
                                    "type": "boolean"
                                },
                                "human_required": {
                                    "type": "boolean"
                                },
                                "human_required_reason": {
                                    "type": "string"
                                },
                                "est_cost_cents": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "registration": {
                        "type": "object",
                        "properties": {
                            "enabled": {
                                "type": "boolean"
                            },
                            "endpoint": {
                                "type": "string"
                            },
                            "verify_endpoint": {
                                "type": "string"
                            },
                            "resend_endpoint": {
                                "type": "string"
                            },
                            "mcp_tools": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "default_scopes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "key_issued": {
                                "type": "string",
                                "const": "immediately"
                            },
                            "email_verification": {
                                "type": "object",
                                "additionalProperties": true
                            },
                            "throttles": {
                                "type": "object",
                                "additionalProperties": true
                            },
                            "terms_url": {
                                "type": "string"
                            },
                            "privacy_url": {
                                "type": "string"
                            },
                            "web_url": {
                                "type": "string"
                            }
                        }
                    },
                    "links": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "tier": {
                        "type": "string",
                        "description": "Only with a bearer key — owner | free | verified."
                    },
                    "account": {
                        "type": "object",
                        "description": "Only with a bearer key.",
                        "additionalProperties": true
                    }
                }
            },
            "ConnectCatalog": {
                "type": "object",
                "properties": {
                    "version": {
                        "type": "string",
                        "description": "Newest verified_at of any client (YYYY-MM-DD)."
                    },
                    "mcp_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "rest_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "server_name": {
                        "type": "string"
                    },
                    "env_var": {
                        "type": "string"
                    },
                    "api_key_placeholder": {
                        "type": "string"
                    },
                    "oauth_enabled": {
                        "type": "boolean"
                    },
                    "default_client": {
                        "type": "string"
                    },
                    "install": {
                        "type": "object",
                        "properties": {
                            "mac": {
                                "type": "string"
                            },
                            "linux": {
                                "type": "string"
                            },
                            "win": {
                                "type": "string"
                            }
                        }
                    },
                    "setup_prompt": {
                        "type": "string"
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "pills": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "clients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "Me": {
                "type": "object",
                "properties": {
                    "user": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "email": {
                                "type": "string"
                            }
                        }
                    },
                    "key": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "scopes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "last_used_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    }
                }
            },
            "Tool": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string"
                    },
                    "pillar": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "mode": {
                        "type": "string",
                        "enum": [
                            "sync",
                            "async"
                        ]
                    },
                    "input": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "required": {
                                    "type": "boolean"
                                },
                                "advanced": {
                                    "type": "boolean"
                                }
                            }
                        }
                    },
                    "output": {
                        "type": "string"
                    },
                    "cost_cents_estimate": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "available": {
                        "type": "boolean"
                    }
                }
            },
            "RunStatus": {
                "type": "string",
                "enum": [
                    "queued",
                    "running",
                    "done",
                    "failed"
                ]
            },
            "Run": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "tool": {
                        "type": "string"
                    },
                    "pillar": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "$ref": "#/components/schemas/RunStatus"
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "model": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cost_cents": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "input": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "output": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "request_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "latency_ms": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "api_key_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "meta": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "web_url": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "TaskStatus": {
                "type": "string",
                "enum": [
                    "queued",
                    "running",
                    "waiting",
                    "blocked",
                    "done",
                    "failed",
                    "cancelled"
                ]
            },
            "TaskPlan": {
                "type": "object",
                "required": [
                    "title",
                    "steps"
                ],
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "goal": {
                        "type": "string"
                    },
                    "budget_cents": {
                        "type": "integer"
                    },
                    "context": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "steps": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "key",
                                "kind"
                            ],
                            "properties": {
                                "key": {
                                    "type": "string"
                                },
                                "kind": {
                                    "type": "string",
                                    "enum": [
                                        "tool",
                                        "agent",
                                        "wait",
                                        "human",
                                        "fanout",
                                        "noop"
                                    ]
                                },
                                "deps": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            },
                            "additionalProperties": true
                        }
                    }
                }
            },
            "Task": {
                "type": "object",
                "properties": {
                    "uuid": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "title": {
                        "type": "string"
                    },
                    "goal": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "$ref": "#/components/schemas/TaskStatus"
                    },
                    "blocked_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "budget_cents": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "spent_cents": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "parent_task_uuid": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "root_run_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "approve_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "last_event_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "step_counts": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    },
                    "pending_approvals": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "steps": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TaskEvent"
                        }
                    }
                }
            },
            "TaskEvent": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string"
                    },
                    "task_uuid": {
                        "type": "string"
                    },
                    "step_key": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "run_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "payload": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "StorageEntry": {
                "type": "object",
                "properties": {
                    "path": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "file",
                            "dir"
                        ]
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "modified": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "etag": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "alias_of": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "IntegrationStatus": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "managed": {
                        "type": "boolean"
                    },
                    "oauth": {
                        "type": "boolean"
                    },
                    "configured": {
                        "type": "boolean"
                    },
                    "has_credentials": {
                        "type": "boolean"
                    },
                    "tested_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "test_ok": {
                        "type": [
                            "boolean",
                            "null"
                        ]
                    },
                    "catalog_alias": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "docs": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "manage_url": {
                        "type": "string"
                    }
                }
            },
            "IntegrationCredentialStatus": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "configured": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "masked": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "last_test": {
                        "type": "object",
                        "properties": {
                            "ok": {
                                "type": "boolean"
                            },
                            "at": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "IntegrationProvider": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "self_service": {
                        "type": "boolean"
                    },
                    "fields": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "secret": {
                                    "type": "boolean"
                                },
                                "required": {
                                    "type": "boolean"
                                },
                                "format": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "signup_url": {
                        "type": "string"
                    },
                    "docs_url": {
                        "type": "string"
                    },
                    "key_format": {
                        "type": "string"
                    },
                    "pricing_url": {
                        "type": "string"
                    },
                    "authorize_url": {
                        "type": "string"
                    },
                    "authorize_via": {
                        "type": "string"
                    },
                    "human_required_reason": {
                        "type": "string"
                    },
                    "optional_slot_of": {
                        "type": "string"
                    }
                }
            },
            "UsageCounts": {
                "type": "object",
                "properties": {
                    "runs": {
                        "type": "integer"
                    },
                    "done": {
                        "type": "integer"
                    },
                    "failed": {
                        "type": "integer"
                    },
                    "in_progress": {
                        "type": "integer"
                    },
                    "cost_cents": {
                        "type": "integer"
                    }
                }
            },
            "JsonRpcRequest": {
                "type": "object",
                "required": [
                    "jsonrpc",
                    "method"
                ],
                "properties": {
                    "jsonrpc": {
                        "type": "string",
                        "const": "2.0"
                    },
                    "id": {
                        "type": [
                            "integer",
                            "string",
                            "null"
                        ]
                    },
                    "method": {
                        "type": "string",
                        "examples": [
                            "initialize",
                            "ping",
                            "tools/list",
                            "tools/call"
                        ]
                    },
                    "params": {
                        "type": "object",
                        "additionalProperties": true
                    }
                }
            },
            "JsonRpcResponse": {
                "type": "object",
                "required": [
                    "jsonrpc"
                ],
                "properties": {
                    "jsonrpc": {
                        "type": "string",
                        "const": "2.0"
                    },
                    "id": {
                        "type": [
                            "integer",
                            "string",
                            "null"
                        ]
                    },
                    "result": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "integer"
                            },
                            "message": {
                                "type": "string"
                            },
                            "data": {}
                        }
                    }
                }
            }
        }
    },
    "x-aicharged-tools": [
        {
            "slug": "image.background_removal",
            "mcp_name": "image_background_removal",
            "pillar": "image",
            "label": "Background removal",
            "description": "Cut out the subject from an uploaded image; returns a transparent PNG.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": 5,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.upscale",
            "mcp_name": "image_upscale",
            "pillar": "image",
            "label": "Upscale & enhance",
            "description": "Increase resolution while preserving detail.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": 10,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.generate",
            "mcp_name": "image_generate",
            "pillar": "image",
            "label": "Generate from prompt",
            "description": "Text-to-image generation. Pick a model per look/quality target.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": 5,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.edit",
            "mcp_name": "image_edit",
            "pillar": "image",
            "label": "Edit a photo",
            "description": "Edit an existing reference photo by instruction: change clothing, background or composition while preserving the person and identity. Use for professional headshots from a real photo. Supply an accessible image_url (storage_share_url for a private stored file) and the desired edit in prompt. Returns the edited image.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": null,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.erase_object",
            "mcp_name": "image_erase_object",
            "pillar": "image",
            "label": "Erase object / cleanup",
            "description": "Remove unwanted objects, people or clutter from a photo. Describe what to erase; leave blank to clear distracting background elements.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "prompt": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "image",
            "cost_cents_estimate": 5,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.style_transfer",
            "mcp_name": "image_style_transfer",
            "pillar": "image",
            "label": "Style transfer",
            "description": "Repaint an image in a target visual style described in the prompt, keeping the original composition.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": 5,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.relight",
            "mcp_name": "image_relight",
            "pillar": "image",
            "label": "Relight subject",
            "description": "Re-light an image to a new lighting scenario described in the prompt (e.g. \"warm sunset window light\"). Great for product and portrait consistency.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "image",
            "cost_cents_estimate": 6,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.expand",
            "mcp_name": "image_expand",
            "pillar": "image",
            "label": "Expand / outpaint",
            "description": "Extend an image to a new aspect ratio, generating plausible content beyond the original frame. Set the target ratio (e.g. 16:9, 1:1, 9:16).",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "aspect_ratio": {
                    "type": "text",
                    "required": true,
                    "default": "16:9"
                }
            },
            "output": "image",
            "cost_cents_estimate": 6,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.transcribe",
            "mcp_name": "audio_transcribe",
            "pillar": "audio",
            "label": "Speech-to-text",
            "description": "Transcribe an uploaded audio file. Diarization optional.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "audio_url": {
                    "type": "audio",
                    "required": true
                }
            },
            "output": "text",
            "cost_cents_estimate": 3,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.recognize",
            "mcp_name": "audio_recognize",
            "pillar": "audio",
            "label": "Music recognition",
            "description": "Identify the song playing in an audio or video file (Shazam-style): title, artist, album, cover art, ISRC, genres and Apple Music / Spotify links. Give audio_url (an http(s) link to the audio or video), or a file from your storage as storage_path (+ storage_provider, default your first bucket). start_seconds picks where the ~20-second sample starts. No match = a failed run with \"No match\".",
            "mode": "sync",
            "provider": "acrcloud",
            "managed": false,
            "input": {
                "audio_url": {
                    "type": "audio",
                    "required": false
                },
                "storage_path": {
                    "type": "text",
                    "required": false
                },
                "storage_provider": {
                    "type": "text",
                    "required": false
                },
                "start_seconds": {
                    "type": "number",
                    "required": false,
                    "default": 0
                }
            },
            "output": "json",
            "cost_cents_estimate": 1,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.tts",
            "mcp_name": "audio_tts",
            "pillar": "audio",
            "label": "Text-to-speech",
            "description": "Generate expressive multilingual speech directly with ElevenLabs Eleven v3. Supports inline delivery tags such as [dryly], [whispers] and [chuckles].",
            "mode": "sync",
            "provider": "elevenlabs",
            "managed": false,
            "input": {
                "text": {
                    "type": "text",
                    "required": true
                },
                "voice": {
                    "type": "text",
                    "required": false,
                    "default": "George"
                },
                "voice_id": {
                    "type": "text",
                    "required": false
                },
                "language_code": {
                    "type": "text",
                    "required": false,
                    "default": "cs"
                },
                "stability": {
                    "type": "number",
                    "required": false,
                    "default": 0.42
                },
                "similarity_boost": {
                    "type": "number",
                    "required": false,
                    "default": 0.78
                },
                "style": {
                    "type": "number",
                    "required": false,
                    "default": 0.32
                },
                "speed": {
                    "type": "number",
                    "required": false,
                    "default": 1
                }
            },
            "output": "audio",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.speech",
            "mcp_name": "audio_speech",
            "pillar": "audio",
            "label": "Read aloud (fast speech)",
            "description": "Turn text into natural speech fast with Cartesia Sonic — low latency, many languages including Czech. Ideal for reading replies aloud. Leave the voice empty for a default voice of the chosen language, or pass a Cartesia voice id.",
            "mode": "sync",
            "provider": "cartesia",
            "managed": false,
            "input": {
                "text": {
                    "type": "text",
                    "required": true
                },
                "language": {
                    "type": "text",
                    "required": false,
                    "default": "cs"
                },
                "voice": {
                    "type": "text",
                    "required": false
                },
                "speed": {
                    "type": "number",
                    "required": false,
                    "default": 1
                }
            },
            "output": "audio",
            "cost_cents_estimate": 1,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.music_generate",
            "mcp_name": "audio_music_generate",
            "pillar": "audio",
            "label": "Generate music",
            "description": "Generate an instrumental music clip from a short text brief of genre, mood and instruments (e.g. \"lofi hip-hop, mellow, rainy night\").",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "tags": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "audio",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.sound_effects",
            "mcp_name": "audio_sound_effects",
            "pillar": "audio",
            "label": "Sound effects",
            "description": "Generate a short sound effect from a text description (e.g. \"glass shattering on tile, close mic\").",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "text": {
                    "type": "text",
                    "required": true
                },
                "duration_seconds": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "audio",
            "cost_cents_estimate": 2,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "audio.separate",
            "mcp_name": "audio_separate",
            "pillar": "audio",
            "label": "Separate stems / denoise",
            "description": "Split an uploaded track into isolated stems (vocals, drums, bass, …) so you can mute noise or remix. Returns one file per stem.",
            "mode": "sync",
            "provider": "fal",
            "managed": false,
            "input": {
                "audio_url": {
                    "type": "audio",
                    "required": true
                }
            },
            "output": "json",
            "cost_cents_estimate": 6,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.lipsync",
            "mcp_name": "video_lipsync",
            "pillar": "video",
            "label": "Lip sync",
            "description": "Align mouth motion to a target audio track. Async — minutes per clip.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "video_url": {
                    "type": "video",
                    "required": true
                },
                "audio_url": {
                    "type": "audio",
                    "required": true
                }
            },
            "output": "video",
            "cost_cents_estimate": 50,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.text_to_video",
            "mcp_name": "video_text_to_video",
            "pillar": "video",
            "label": "Text to video",
            "description": "Generate a short video clip from a text prompt. Async — a clip takes up to a few minutes.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "video",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.image_to_video",
            "mcp_name": "video_image_to_video",
            "pillar": "video",
            "label": "Image to video",
            "description": "Animate a still image into a short video, guided by a motion prompt. Async — up to a few minutes per clip.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                },
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "video",
            "cost_cents_estimate": 5,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.ai_director",
            "mcp_name": "video_ai_director",
            "pillar": "video",
            "label": "AI video director",
            "description": "Direct a video from a text brief plus up to 3 reference images and a reference video (motion/camera/depth-map), with cinematic camera control. For spoken dialogue, fill in \"Dialogue text\" — the tool automatically generates a language-accurate voice-over and lip-syncs it (Seedance's own native speech synthesis is unreliable for non-English dialogue). Tick \"Plan it for me\" and the tool writes the whole shot breakdown from your brief: it looks at the reference images you uploaded, decides the scenes and their timing, which ones must be spliced from your real artwork and which are generated, and how the narration divides up. Or supply a structured \"Shots\" breakdown yourself — the tool then automatically composes a professional 2K/4K storyboard sheet (one grounded reference photo per shot + Visual/Action/Dialogue/timing) AND derives the video prompt and dialogue script from the exact same breakdown, so the storyboard and the final video match. Async — a clip takes a few minutes. Materially more expensive than the other video tools (~$2-3/clip with dialogue, +~$0.20/shot with a storyboard) — see the cost estimate before running.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "reference_image_1": {
                    "type": "image",
                    "required": false
                },
                "reference_image_2": {
                    "type": "image",
                    "required": false
                },
                "reference_image_3": {
                    "type": "image",
                    "required": false
                },
                "reference_video": {
                    "type": "video",
                    "required": false
                },
                "reference_audio": {
                    "type": "audio",
                    "required": false
                },
                "dialogue_text": {
                    "type": "text",
                    "required": false
                },
                "dialogue_language": {
                    "type": "text",
                    "required": false,
                    "default": "cs"
                },
                "dialogue_voice": {
                    "type": "text",
                    "required": false,
                    "default": "Charon"
                },
                "duration_seconds": {
                    "type": "number",
                    "required": false,
                    "default": 8
                },
                "resolution": {
                    "type": "text",
                    "required": false,
                    "default": "720p"
                },
                "aspect_ratio": {
                    "type": "text",
                    "required": false,
                    "default": "16:9"
                },
                "shots": {
                    "type": "text",
                    "required": false
                },
                "auto_plan": {
                    "type": "boolean",
                    "required": false,
                    "default": false
                },
                "storyboard_title": {
                    "type": "text",
                    "required": false
                },
                "storyboard_style": {
                    "type": "text",
                    "required": false
                },
                "storyboard_audience": {
                    "type": "text",
                    "required": false
                },
                "storyboard_audio_hint": {
                    "type": "text",
                    "required": false
                },
                "storyboard_resolution": {
                    "type": "text",
                    "required": false,
                    "default": "2k"
                }
            },
            "output": "video",
            "cost_cents_estimate": 194,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.dub",
            "mcp_name": "video_dub",
            "pillar": "video",
            "label": "Video dubbing & translation",
            "description": "Dub and translate a video into another language end-to-end: transcribe the speech, translate it, regenerate the voice (optionally cloning the original speaker) and, optionally, lip-sync the mouth motion. Runs on our managed pipeline. Async — minutes per clip; poll the run for the result.",
            "mode": "async",
            "provider": "aiio_dubbing",
            "managed": true,
            "input": {
                "video_url": {
                    "type": "video",
                    "required": true
                },
                "target_lang": {
                    "type": "text",
                    "required": true
                },
                "source_lang": {
                    "type": "text",
                    "required": false
                },
                "tts_type": {
                    "type": "text",
                    "required": false
                },
                "tts_voice_id": {
                    "type": "text",
                    "required": false
                },
                "translate_type": {
                    "type": "text",
                    "required": false
                },
                "lip_sync": {
                    "type": "boolean",
                    "required": false,
                    "default": false
                },
                "lip_sync_engine": {
                    "type": "text",
                    "required": false
                },
                "lip_sync_quality": {
                    "type": "text",
                    "required": false
                },
                "start": {
                    "type": "number",
                    "required": false
                },
                "duration": {
                    "type": "number",
                    "required": false
                }
            },
            "output": "video",
            "cost_cents_estimate": 60,
            "access": [
                "credits"
            ]
        },
        {
            "slug": "video.fetch",
            "mcp_name": "video_fetch",
            "pillar": "video",
            "label": "Fetch media from URL",
            "description": "Download a video, its audio, metadata or subtitles from any yt-dlp–supported URL (YouTube, Vimeo, and 1000+ sites) straight into your storage. An ingest step that feeds the other tools — transcribe, dub, separate. Async; the result lands in R2.",
            "mode": "async",
            "provider": "aiio_tools",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": true
                },
                "mode": {
                    "type": "text",
                    "required": false,
                    "default": "video"
                },
                "format": {
                    "type": "text",
                    "required": false
                },
                "audio_format": {
                    "type": "text",
                    "required": false
                },
                "quality": {
                    "type": "text",
                    "required": false,
                    "default": "best"
                },
                "subtitle_langs": {
                    "type": "text",
                    "required": false
                },
                "max_filesize_mb": {
                    "type": "number",
                    "required": false
                },
                "max_duration_s": {
                    "type": "number",
                    "required": false
                }
            },
            "output": "video",
            "cost_cents_estimate": 2,
            "access": [
                "credits"
            ]
        },
        {
            "slug": "video.translate",
            "mcp_name": "video_translate",
            "pillar": "video",
            "label": "Translate a video",
            "description": "Translate any YouTube video's spoken content into another language as a timestamped transcript/subtitles — read straight from the video, no captions required. For a full re-voiced dub use Video dubbing.",
            "mode": "async",
            "provider": "aiio_youtube",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": true
                },
                "target_lang": {
                    "type": "text",
                    "required": true
                },
                "format": {
                    "type": "text",
                    "required": false,
                    "default": "transcript"
                }
            },
            "output": "text",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.timeline",
            "mcp_name": "video_timeline",
            "pillar": "video",
            "label": "Video content timeline",
            "description": "Turn any YouTube video into a timestamped content timeline + ready-to-paste YouTube chapters, from its actual audio and visuals.",
            "mode": "async",
            "provider": "aiio_youtube",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": true
                },
                "granularity": {
                    "type": "text",
                    "required": false,
                    "default": "normal"
                }
            },
            "output": "text",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.quotes",
            "mcp_name": "video_quotes",
            "pillar": "video",
            "label": "Funny quotes & highlights",
            "description": "Pull the funniest / most memorable spoken lines from any YouTube video, with MM:SS timestamps and a downloadable .txt — great for shorts, clips and social posts.",
            "mode": "async",
            "provider": "aiio_youtube",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": true
                },
                "count": {
                    "type": "number",
                    "required": false,
                    "default": 8
                },
                "language": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.youtube_search",
            "mcp_name": "data_youtube_search",
            "pillar": "data",
            "label": "Search across YouTube videos",
            "description": "Ask a question across one or more YouTube videos you supply by URL and get an answer with exact MM:SS citations — search inside any channel's content.",
            "mode": "async",
            "provider": "aiio_youtube",
            "managed": true,
            "input": {
                "urls": {
                    "type": "text",
                    "required": true
                },
                "query": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "text",
            "cost_cents_estimate": 4,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.thumbnail_advisor",
            "mcp_name": "image_thumbnail_advisor",
            "pillar": "image",
            "label": "Thumbnail analysis & redesign",
            "description": "Analyse a YouTube thumbnail for channel-identity consistency and clickability/conversion, then generate improved on-brand variants (Nano Banana Pro) you can A/B test.",
            "mode": "async",
            "provider": "aiio_youtube",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": true
                },
                "channel_context": {
                    "type": "text",
                    "required": false
                },
                "num_variants": {
                    "type": "number",
                    "required": false,
                    "default": 2
                }
            },
            "output": "image",
            "cost_cents_estimate": 20,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.grok",
            "mcp_name": "data_grok",
            "pillar": "data",
            "label": "Ask Grok (xAI)",
            "description": "Reason, write or analyse with xAI's Grok (grok-4.3) — strong reasoning + up-to-date knowledge. Plain text in, text out. A plain model call on xAI's cloud: it cannot act on or reach the user's machines, tailnet, SSH or Hetzner (use machine_action_run / hetzner_* for that).",
            "mode": "sync",
            "provider": "xai",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "system": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 3,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "image.grok",
            "mcp_name": "image_grok",
            "pillar": "image",
            "label": "Generate image with Grok",
            "description": "Text-to-image with xAI Grok Imagine — vivid, photoreal or stylised images from a prompt.",
            "mode": "sync",
            "provider": "xai",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "aspect_ratio": {
                    "type": "text",
                    "required": false,
                    "default": "16:9"
                },
                "resolution": {
                    "type": "text",
                    "required": false,
                    "default": "2k"
                }
            },
            "output": "image",
            "cost_cents_estimate": 14,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "video.grok",
            "mcp_name": "video_grok",
            "pillar": "video",
            "label": "Generate video with Grok",
            "description": "Text-to-video with xAI Grok Imagine — a short clip (up to 15s) from a prompt. Async; the result lands in the run.",
            "mode": "async",
            "provider": "xai",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "duration": {
                    "type": "number",
                    "required": false,
                    "default": 8
                },
                "aspect_ratio": {
                    "type": "text",
                    "required": false,
                    "default": "16:9"
                },
                "resolution": {
                    "type": "text",
                    "required": false,
                    "default": "720p"
                }
            },
            "output": "video",
            "cost_cents_estimate": 50,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "x.post",
            "mcp_name": "x_post",
            "pillar": "social",
            "label": "Post to X.com",
            "description": "Publish a post (tweet) to your connected X.com account. Connect X first in Integrations (one-click OAuth).",
            "mode": "sync",
            "provider": "x_twitter",
            "managed": false,
            "input": {
                "text": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.x_bookmarks",
            "mcp_name": "data_x_bookmarks",
            "pillar": "social",
            "label": "Read my X Bookmarks",
            "description": "Load your saved X.com Bookmarks. Requires the bookmark.read scope (re-connect X) and a usage-billed X API.",
            "mode": "sync",
            "provider": "x_twitter",
            "managed": false,
            "input": {
                "count": {
                    "type": "number",
                    "required": false,
                    "default": 25
                }
            },
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.x_likes",
            "mcp_name": "data_x_likes",
            "pillar": "social",
            "label": "Read my X Likes (Favorites)",
            "description": "Load your X.com Likes / Favorites. Requires the like.read scope (re-connect X) and a usage-billed X API.",
            "mode": "sync",
            "provider": "x_twitter",
            "managed": false,
            "input": {
                "count": {
                    "type": "number",
                    "required": false,
                    "default": 25
                }
            },
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.x_archive",
            "mcp_name": "data_x_archive",
            "pillar": "social",
            "label": "Archive my X (Bookmarks + Likes)",
            "description": "Import ALL your X.com Bookmarks (with folders + media) and Likes into your aicharged account, mirroring media to R2. Async; usage-billed on your X credits (~$0.005/post read).",
            "mode": "async",
            "provider": "x_twitter",
            "managed": false,
            "input": {},
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.history_sync",
            "mcp_name": "data_history_sync",
            "pillar": "data",
            "label": "Import & sync my AI chat history",
            "description": "Mirror your ChatGPT, Claude and Gemini conversations, memories and projects into aicharged — from an export file you uploaded or live from the account you connected in the chat. Idempotent: re-running only adds what is new. No provider cost.",
            "mode": "async",
            "provider": "aiio_history",
            "managed": true,
            "input": {
                "provider": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "",
                        "chatgpt",
                        "claude",
                        "gemini"
                    ]
                },
                "connection_id": {
                    "type": "integer",
                    "required": false
                },
                "export_staged": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "free"
            ]
        },
        {
            "slug": "3d.interactive_scene",
            "mcp_name": "3d_interactive_scene",
            "pillar": "3d",
            "label": "Interactive 3D scene",
            "description": "Create a reusable interactive 3D warehouse. scene_template=top (default) preserves the original three-motor overhead warehouse; front creates the front manipulator. Exported scene_json version=1 accepts warehouse config in mm, state and parts (declarative data). To import an existing web demo unchanged, first upload its static ZIP using storage_put or storage_upload_*. Then pass scene_json with version=2, template=static-bundle, bundle_path (owned storage key), storage_provider=r2, sha256 (archive digest), entrypoint (e.g. mobile-robot/index.html), title. ZIP is verified and preserved permanently with the run; HTML/JS execute only in a sandbox on the separate 3d.aicharged.io origin. No physical machine control. Zero provider cost.",
            "mode": "sync",
            "provider": "interactive_scene",
            "managed": true,
            "input": {
                "scene_template": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "top",
                        "front"
                    ]
                },
                "scene_json": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "3d_scene",
            "cost_cents_estimate": 0,
            "access": [
                "free"
            ]
        },
        {
            "slug": "3d.image_to_3d",
            "mcp_name": "3d_image_to_3d",
            "pillar": "3d",
            "label": "Image to 3D",
            "description": "Convert a single image into an explorable 3D model.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "image_url": {
                    "type": "image",
                    "required": true
                }
            },
            "output": "3d_model",
            "cost_cents_estimate": 30,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "3d.text_to_3d",
            "mcp_name": "3d_text_to_3d",
            "pillar": "3d",
            "label": "Text to 3D",
            "description": "Generate a textured 3D model from a text prompt. Async — generation takes a few minutes.",
            "mode": "async",
            "provider": "fal",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                }
            },
            "output": "3d_model",
            "cost_cents_estimate": 25,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.summarize",
            "mcp_name": "data_summarize",
            "pillar": "data",
            "label": "Summarize text",
            "description": "Paste a long passage and get a concise summary. Optionally tweak the instruction (length, tone, bullet vs prose).",
            "mode": "sync",
            "provider": "openrouter",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "system": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 1,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.extract_structured",
            "mcp_name": "data_extract_structured",
            "pillar": "data",
            "label": "Extract structured data",
            "description": "Pull structured fields out of messy text — names, dates, amounts, entities — returned as JSON.",
            "mode": "sync",
            "provider": "openrouter",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "system": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "json",
            "cost_cents_estimate": 1,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.ocr",
            "mcp_name": "data_ocr",
            "pillar": "data",
            "label": "Document OCR (PDF / image → text)",
            "description": "Read a PDF or an image (scan, photo of a page, screenshot) into clean markdown with headings, lists and simple tables, plain text, or layout JSON with boxes. Give file_url (an http(s) link — e.g. a signed link from storage_share_url) or a file from your storage as storage_path (+ storage_provider). pages picks PDF pages (\"1-3,5\"); ocr_mode: auto (use a digital PDF's own text layer, OCR the rest), ocr (always OCR) or text. Fast, CPU-only. Weak on handwriting, complex merged-cell tables and old degraded scans. Async; the document lands in R2 and the text in the run.",
            "mode": "async",
            "provider": "aiio_tools",
            "managed": true,
            "input": {
                "file_url": {
                    "type": "file",
                    "required": false
                },
                "mode": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "markdown",
                        "text",
                        "json"
                    ],
                    "default": "markdown"
                },
                "pages": {
                    "type": "text",
                    "required": false
                },
                "ocr_mode": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "auto",
                        "ocr",
                        "text"
                    ],
                    "default": "auto"
                },
                "max_pages": {
                    "type": "integer",
                    "required": false
                },
                "storage_path": {
                    "type": "text",
                    "required": false
                },
                "storage_provider": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 1,
            "access": [
                "credits"
            ]
        },
        {
            "slug": "data.classify",
            "mcp_name": "data_classify",
            "pillar": "data",
            "label": "Classify text",
            "description": "Assign a label to a piece of text (sentiment, topic, intent, …). State the label set in the instruction; the model returns the chosen label.",
            "mode": "sync",
            "provider": "openrouter",
            "managed": false,
            "input": {
                "prompt": {
                    "type": "text",
                    "required": true
                },
                "system": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 1,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.web_search",
            "mcp_name": "data_web_search",
            "pillar": "data",
            "label": "Web search answer",
            "description": "Fast answer to a general question from a live web search, in ~1–3 s: current facts, weather, news, prices, exchange rates, opening hours, schedules, \"who/what/when is …\". Returns a concise 2–5 sentence answer (in the question's language, or `language`) plus the cited sources. Pass \"query\" as the user's question in a natural full sentence in their language (not a keyword list, no site: or other search operators) — the search engine answers questions, not keywords. Use THIS for everyday questions. For finding companies/contacts or extracting structured data from websites use data_web_research instead (async, 1–2 min). Optional `engine`: \"sonar-pro\" (default, ~1–2 s), \"sonar\" (cheapest), \"grok\" (xAI search incl. X, ~8 s — news / what is happening on X), \"gemini\" (Gemini + Exa, 12–28 s). Omit it to use the voice agent's choice or the default.",
            "mode": "sync",
            "provider": "openrouter",
            "managed": false,
            "input": {
                "query": {
                    "type": "text",
                    "required": true
                },
                "language": {
                    "type": "text",
                    "required": false
                },
                "max_sources": {
                    "type": "integer",
                    "required": false,
                    "default": 5
                },
                "freshness": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "any",
                        "day",
                        "week",
                        "month"
                    ],
                    "default": "any"
                },
                "engine": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "sonar-pro",
                        "sonar",
                        "grok",
                        "gemini"
                    ]
                }
            },
            "output": "text",
            "cost_cents_estimate": 3,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.web_research",
            "mcp_name": "data_web_research",
            "pillar": "data",
            "label": "Web research",
            "description": "Finds companies/contacts/structured data — async, takes 1–2 min. NOT for general questions (weather, news, facts, prices) — use data_web_search for those. Give it a URL to extract structured data from that page, OR just a topic (no URL) and it researches it itself via live web search from several angles, then visits each found result's own site to dig up further contact details — you never have to find the source yourself. Optional cost/scale knobs for bulk work (all default to the full smart run): `html` — pass already-fetched page HTML/text to skip the fetch+search layer and only run extraction (the cheapest mode). `model` — \"flash-lite\" (cheapest), \"flash\"/\"default\", \"pro\"/\"premium\", or a raw OpenRouter model id, for every LLM call in the run. `angles` (1-3) and `enrich_sites` (0-5) tune topic-mode depth vs cost. `fields` (e.g. \"email,phone\") scopes extraction to just those fields (fewer tokens). `verify` (e.g. \"mx,vies\") adds free, no-LLM server-side trust checks — email domain MX and EU-VAT VIES lookups — on the extracted data. `classify_only` true runs a cheap pre-filter that only answers whether a URL is a real, single, extractable business vs a directory/catalog/aggregator/dictionary page, so a bulk caller can skip garbage before paying for full research. `engine` picks the topic-mode web SEARCH step only: \"sonar-pro\" (default), \"sonar\" (cheapest) or \"gemini\" (Gemini + Exa, slower); omit it to use the voice agent's choice or the default. `model` still drives extraction.",
            "mode": "async",
            "provider": "aiio_research",
            "managed": true,
            "input": {
                "url": {
                    "type": "text",
                    "required": false
                },
                "extract": {
                    "type": "text",
                    "required": true
                },
                "html": {
                    "type": "text",
                    "required": false
                },
                "model": {
                    "type": "text",
                    "required": false
                },
                "fields": {
                    "type": "text",
                    "required": false
                },
                "verify": {
                    "type": "text",
                    "required": false
                },
                "angles": {
                    "type": "integer",
                    "required": false
                },
                "enrich_sites": {
                    "type": "integer",
                    "required": false
                },
                "classify_only": {
                    "type": "boolean",
                    "required": false,
                    "default": false
                },
                "engine": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "sonar-pro",
                        "sonar",
                        "gemini"
                    ]
                }
            },
            "output": "json",
            "cost_cents_estimate": 30,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.compose_message",
            "mcp_name": "data_compose_message",
            "pillar": "data",
            "label": "Compose & send a message",
            "description": "AI drafts a personalized email or SMS for a specific recipient and goal. Drafts only unless you explicitly ask it to send.",
            "mode": "async",
            "provider": "aiio_messaging",
            "managed": true,
            "input": {
                "recipient_name": {
                    "type": "text",
                    "required": false
                },
                "recipient_email": {
                    "type": "text",
                    "required": false
                },
                "recipient_phone": {
                    "type": "text",
                    "required": false
                },
                "goal": {
                    "type": "text",
                    "required": true
                },
                "channel": {
                    "type": "text",
                    "required": true
                },
                "language": {
                    "type": "text",
                    "required": false
                },
                "send": {
                    "type": "boolean",
                    "required": false,
                    "default": false
                }
            },
            "output": "json",
            "cost_cents_estimate": 2,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.grokbot",
            "mcp_name": "data_grokbot",
            "pillar": "data",
            "label": "GrokBot task (Grok Bot)",
            "description": "Delegate a long, multi-step web task to the user's own Grok Bot, an EXTERNAL cloud agent (xAI/Cursor) with NO access to the user's machines, tailnet, SSH or Hetzner — use machine_action_run / hetzner_* for those. It works on its own cloud computer with real web tools and apps (browser, documents, accounts it is already signed in to). Use it WHEN the work needs many steps in real web apps or minutes-to-hours of autonomous effort — research across many sites, filling in web apps, preparing documents. NOT for quick questions (use data_grok or data_web_search). NEVER delegate administration of the user's own computers to it (services, network, SSH, reboots): it cannot reach them and will only report failure. Use machine_actions → machine_action_run for maintenance on the user's mesh machines and hetzner_servers / hetzner_server_power / hetzner_server_rescue for Hetzner. `task` = what to do (required), `context` = background/material it needs, `wait_hint` = how long it may take. The answer arrives asynchronously (usually minutes, at most 6 hours): output.text (Markdown) + output.links. The bot never deletes, pays for or sends anything without the user's confirmation. While it works the bot may send progress notes and QUESTIONS (needs_input — shown in the chat/voice as \"GrokBot asks (run #N)\"). To ANSWER a question, call this tool again with `task` = the user's answer and `reply_to_run` = the number of the run that asked; the bot continues that task in the new run. Billed to the user's own Grok/Cursor subscription (aicharged cost 0). Needs a one-time connection in the aicharged chat (routine webhook URL + API key).",
            "mode": "async",
            "provider": "grokbot",
            "managed": true,
            "input": {
                "task": {
                    "type": "text",
                    "required": true
                },
                "context": {
                    "type": "text",
                    "required": false
                },
                "wait_hint": {
                    "type": "text",
                    "required": false
                },
                "reply_to_run": {
                    "type": "integer",
                    "required": false
                }
            },
            "output": "text",
            "cost_cents_estimate": 0,
            "access": [
                "byok"
            ]
        },
        {
            "slug": "data.diagram",
            "mcp_name": "data_diagram",
            "pillar": "data",
            "label": "Diagram (Mermaid)",
            "description": "Draw a diagram or chart as an IMAGE from Mermaid source: flowchart (process, decisions), sequenceDiagram, mindmap (structure, ideas), timeline, gantt (plan), pie / xychart-beta (numbers), quadrantChart (comparison), erDiagram, classDiagram, stateDiagram-v2, journey, gitGraph. Use it whenever a structure, process, comparison, timeline or numbers come up and a picture helps — write the Mermaid yourself from the conversation (labels in the user's language, short; quote labels with special characters: A[\"Cena (Kč)\"]). `mermaid` = the diagram source (required, ≤ 20 000 chars, first line = diagram type), `title` = a short human caption, `theme` = dark (default) | light, `format` = png (default) | svg (adds a vector file). Rendered on aicharged.io's own server in < 1 s, free. Returns {image, title}: show/announce the image — never read out or display the Mermaid code. On a syntax error the run fails with the parser message: fix the source and call again.",
            "mode": "sync",
            "provider": "aiio_diagrams",
            "managed": true,
            "input": {
                "mermaid": {
                    "type": "text",
                    "required": true
                },
                "title": {
                    "type": "text",
                    "required": false
                },
                "theme": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "dark",
                        "light"
                    ],
                    "default": "dark"
                },
                "format": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "png",
                        "svg"
                    ],
                    "default": "png"
                }
            },
            "output": "image",
            "cost_cents_estimate": 0,
            "access": [
                "free"
            ]
        },
        {
            "slug": "data.flash_iq",
            "mcp_name": "data_flash_iq",
            "pillar": "data",
            "label": "Flash IQ — exact calculation",
            "description": "Exact, native (non-generative) calculation over a text with Oleg's own Flash IQ server: percentages, price changes, unit rates, sharing, cash flows and other quantities stated in the text (`mode` = math, questions of type number), or a prepared program registered on the server (`mode` = prepared). `state` = the text (or a JSON record in prepared mode), `question` = what to compute (with `type` = number), `lang` = cs | en | de | … (optional), or `questions` = a JSON object {\"id\": {\"type\": \"number\", \"instructions\": \"…\"}} for several at once. Answers are exact strings (e.g. \"93.6\", \"1/3\") and ADVISORY: each carries provenance with confirmed=false; an unsupported or ambiguous reading is refused, never guessed. Runs on the MacBook — if the Mac is asleep or offline the run fails visibly; nothing else answers instead. Free, ~10 ms.",
            "mode": "sync",
            "provider": "flash_iq",
            "managed": true,
            "input": {
                "mode": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "math",
                        "prepared"
                    ],
                    "default": "math"
                },
                "state": {
                    "type": "text",
                    "required": true
                },
                "question": {
                    "type": "text",
                    "required": false
                },
                "type": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "number",
                        "bool",
                        "choice",
                        "score",
                        "string",
                        "date",
                        "json"
                    ],
                    "default": "number"
                },
                "lang": {
                    "type": "select",
                    "required": false,
                    "options": [
                        "",
                        "cs",
                        "sk",
                        "en",
                        "de",
                        "ru",
                        "es",
                        "fr",
                        "pt"
                    ],
                    "default": ""
                },
                "questions": {
                    "type": "text",
                    "required": false
                }
            },
            "output": "json",
            "cost_cents_estimate": 0,
            "access": [
                "credits"
            ]
        }
    ],
    "x-aicharged-connect": {
        "version": "2026-10-22",
        "mcp_url": "https://aicharged.io/api/v1/mcp",
        "clients_url": "https://aicharged.io/api/v1/connect/clients",
        "server_card_url": "https://aicharged.io/api/v1/mcp/server-card",
        "agent_guide_url": "https://aicharged.io/agent.md",
        "llms_txt_url": "https://aicharged.io/llms.txt",
        "oauth_enabled": true
    }
}
