{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Runs an AI model using a JSON body containing model, input, and optional options fields. Unlike the model-specific URL endpoint, this endpoint takes the model identifier in the body and nests the model's inputs under input.\n\nUse options.extraHeaders to pass additional provider headers. Accepts Workers AI model identifiers and AI Gateway provider model identifiers.\n\nSee the [Workers AI model catalog](https://developers.cloudflare.com/workers-ai/models/) for Workers AI model inputs, or the provider's documentation for models accessed through AI Gateway.","properties":{"path":{"type":"object","properties":{"account_id":{"description":"Cloudflare account ID used for this AI model request.","type":"string","examples":["023e105f4ecef8ad9ca31a8372d0c353"]}},"required":["account_id"],"additionalProperties":false},"body":{"type":"object","properties":{"input":{"description":"JSON object containing the selected model's input fields, such as prompt or messages. Do not include model or options inside this object.","type":"object","examples":[{"prompt":"Tell me a joke"}]},"model":{"description":"The AI model to execute (e.g., @cf/google/gemma-4-26b-a4b-it, openai/gpt-5.5, anthropic/claude-opus-4.7)","type":"string","examples":["openai/gpt-5.5"]},"options":{"type":"object","properties":{"extraHeaders":{"description":"Additional headers to pass to the AI provider","type":"object","additionalProperties":{"type":"string"}},"gateway":{"type":"object","properties":{"cacheTtl":{"description":"Cache TTL in seconds","type":"number","examples":[3600]},"id":{"description":"AI Gateway ID for caching and logging","type":"string","examples":["my-gateway"]},"skipCache":{"description":"Skip cache lookup for this request","type":"boolean"}}}}}},"required":["model","input"]}},"required":["path"],"additionalProperties":false},"name":"Run an AI model with request options","id":"cloudflare.workers-ai-post-run-generic","example":{"path":{"account_id":"023e105f4ecef8ad9ca31a8372d0c353"}},"maxRequests":1,"summary":false}}