{"openapi":"3.1.0","info":{"title":"OpenRouter API keys, guardrails, workspaces, budgets and batches (your key) API","version":"0.1.0","description":"OpenRouter API keys, guardrails, workspaces, budgets and batches (your key) lets an AI assistant read your own OpenRouter Admin data through the OpenRouter Admin API with a key you supply (OpenRouter management key (batch tools also accept a normal API key)). Read-only: 11 tools (list_api_keys, get_api_key, list_guardrails, get_guardrail, list_workspaces, get_workspace, list_workspace_budgets,...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openrouter-admin.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openrouter-admin/docs"},"termsOfService":"https://connectorbay.com/byok-openrouter-admin/terms"},"servers":[{"url":"https://byok-openrouter-admin.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openrouter-admin/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_api_keys":{"post":{"operationId":"list_api_keys","summary":"List the API keys of the account (hash, label, disabled flag, spending limit, remaining limit and usage in USD per day, ","description":"List the API keys of the account (hash, label, disabled flag, spending limit, remaining limit and usage in USD per day, week and month). Secret key values are never returned. Needs a management key. Use for \"Which of my OpenRouter API keys spent the most this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"include_disabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include disabled keys.","title":"Include Disabled"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of records to skip, for paging (pages hold up to 100 records).","title":"Offset"},"workspace_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only records of this workspace id. Omit to use the account's default workspace.","title":"Workspace Id"}},"title":"list_api_keysArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_api_key":{"post":{"operationId":"get_api_key","summary":"Get one OpenRouter API key's metadata by its hash: limit, remaining limit and usage in USD, creation and last use time. ","description":"Get one OpenRouter API key's metadata by its hash: limit, remaining limit and usage in USD, creation and last use time. Needs a management key. Use for \"How much of its limit has the OpenRouter key with a given hash used\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"hash":{"description":"Hash identifier of the key, as returned by list_api_keys.","maxLength":200,"title":"Hash","type":"string"}},"required":["hash"],"title":"get_api_keyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_guardrails":{"post":{"operationId":"list_guardrails","summary":"List guardrails (spending limits and allowed or ignored models and providers, zero-data-retention enforcement) of a work","description":"List guardrails (spending limits and allowed or ignored models and providers, zero-data-retention enforcement) of a workspace. Needs a management key. Use for \"Which OpenRouter guardrails limit my spending or restrict providers\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of records to skip, for paging (pages hold up to 100 records).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many records to return (1 to 100).","title":"Limit"},"workspace_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only records of this workspace id. Omit to use the account's default workspace.","title":"Workspace Id"}},"title":"list_guardrailsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_guardrail":{"post":{"operationId":"get_guardrail","summary":"Get one guardrail's limits and model and provider rules by id. Needs a management key. Use for \"What rules does a given ","description":"Get one guardrail's limits and model and provider rules by id. Needs a management key. Use for \"What rules does a given OpenRouter guardrail enforce\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Guardrail id, as returned by list_guardrails.","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_guardrailArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_workspaces":{"post":{"operationId":"list_workspaces","summary":"List workspaces with their default models, provider sort order and observability settings. Needs a management key. Use f","description":"List workspaces with their default models, provider sort order and observability settings. Needs a management key. Use for \"What OpenRouter workspaces do I have and what are their default models\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of records to skip, for paging (pages hold up to 100 records).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many records to return (1 to 100).","title":"Limit"}},"title":"list_workspacesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_workspace":{"post":{"operationId":"get_workspace","summary":"Get one workspace by id or slug: defaults, default guardrail and observability flags. Needs a management key. Use for \"W","description":"Get one workspace by id or slug: defaults, default guardrail and observability flags. Needs a management key. Use for \"What are the default settings of my main OpenRouter workspace\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Workspace id (UUID) or slug.","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_workspaceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_workspace_budgets":{"post":{"operationId":"list_workspace_budgets","summary":"List the spending budgets of a workspace (limit in USD per reset interval). Needs a management key. Use for \"What spendi","description":"List the spending budgets of a workspace (limit in USD per reset interval). Needs a management key. Use for \"What spending budgets are set on my OpenRouter workspace\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"workspace_ref":{"description":"Workspace id (UUID) or slug.","maxLength":200,"title":"Workspace Ref","type":"string"}},"required":["workspace_ref"],"title":"list_workspace_budgetsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_presets":{"post":{"operationId":"list_presets","summary":"List saved presets (named model and routing configurations) with slug, status and designated version id. Needs a managem","description":"List saved presets (named model and routing configurations) with slug, status and designated version id. Needs a management key. Use for \"Which OpenRouter presets have I saved\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of records to skip, for paging (pages hold up to 100 records).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many records to return (1 to 100).","title":"Limit"}},"title":"list_presetsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_provider_keys":{"post":{"operationId":"list_provider_keys","summary":"List the provider keys you attached to OpenRouter (bring your own key): provider, label, fallback and required flags. Ke","description":"List the provider keys you attached to OpenRouter (bring your own key): provider, label, fallback and required flags. Key secrets are never returned. Needs a management key. Use for \"Which of my own provider keys are connected to OpenRouter\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of records to skip, for paging (pages hold up to 100 records).","title":"Offset"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many records to return (1 to 100).","title":"Limit"},"workspace_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only records of this workspace id. Omit to use the account's default workspace.","title":"Workspace Id"},"provider":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only keys of this provider slug, for example openai or anthropic.","title":"Provider"}},"title":"list_provider_keysArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_batches":{"post":{"operationId":"list_batches","summary":"List OpenRouter batch jobs with status, model, request counts and timestamps (no request or result content). Use for \"Ar","description":"List OpenRouter batch jobs with status, model, request counts and timestamps (no request or result content). Use for \"Are my OpenRouter batch jobs finished\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many batches to return (1 to 100).","title":"Limit"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Batch id from the previous page's last_id to continue after.","title":"After"}},"title":"list_batchesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_batch":{"post":{"operationId":"get_batch","summary":"Get the status of one OpenRouter batch job: state, model, request counts and finish time (no results content). Use for \"","description":"Get the status of one OpenRouter batch job: state, model, request counts and finish time (no results content). Use for \"What is the status of my OpenRouter batch job\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Batch job id returned when the batch was submitted.","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_batchArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}