{"openapi":"3.1.0","info":{"title":"OpenRouter (BYOK) API","version":"0.1.0","description":"OpenRouter (BYOK) lets an AI assistant read your own OpenRouter data through the OpenRouter API with a key you supply (API key (some tools need a management key)). Read-only: 8 tools (list_models, count_models, list_embedding_models, list_providers, get_current_key, get_credits, get_activity, get_generation). The BYOK key travels with each request, is used for that one call only and is never...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openrouter.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openrouter/docs"},"termsOfService":"https://connectorbay.com/byok-openrouter/terms"},"servers":[{"url":"https://byok-openrouter.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openrouter/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_models":{"post":{"operationId":"list_models","summary":"List models on OpenRouter with context length, per-token prices and supported parameters. Prices are USD per token as te","description":"List models on OpenRouter with context length, per-token prices and supported parameters. Prices are USD per token as text. Filter by search text, author or modality. Use for \"Which OpenRouter models have the cheapest prompt price and a long context\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"q":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Free-text search by model name or slug.","title":"Q"},"sort":{"anyOf":[{"enum":["most-popular","newest","top-weekly","pricing-low-to-high","pricing-high-to-low","context-high-to-low","throughput-high-to-low","latency-low-to-high"],"type":"string"},{"type":"null"}],"default":null,"description":"Server-side order.","title":"Sort"},"model_authors":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated author slugs to keep, for example 'anthropic,openai'.","title":"Model Authors"},"input_modalities":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated input modalities to require: text, image, audio, file.","title":"Input Modalities"},"output_modalities":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated output modalities: text, image, embeddings, audio, video, rerank, speech, transcription, or 'all' (default text).","title":"Output Modalities"},"supported_parameters":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated request parameters the model must support, for example 'tools'.","title":"Supported Parameters"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many models to return (1 to 1000). Without limit and offset the whole list is returned.","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"How many models to skip.","title":"Offset"}},"title":"list_modelsArguments","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/count_models":{"post":{"operationId":"count_models","summary":"Count the models on OpenRouter, optionally for one output modality. Use for \"How many models does OpenRouter offer\".","description":"Count the models on OpenRouter, optionally for one output modality. Use for \"How many models does OpenRouter offer\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"output_modalities":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Output modality to count, for example 'text' or 'image'.","title":"Output Modalities"}},"title":"count_modelsArguments","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_embedding_models":{"post":{"operationId":"list_embedding_models","summary":"List embedding models on OpenRouter with context length and prices. Use for \"Which embedding models can I use on OpenRou","description":"List embedding models on OpenRouter with context length and prices. Use for \"Which embedding models can I use on OpenRouter\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many models to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"How many models to skip.","title":"Offset"}},"title":"list_embedding_modelsArguments","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_providers":{"post":{"operationId":"list_providers","summary":"List the inference providers behind OpenRouter with headquarters, data centers and links to their policy and status page","description":"List the inference providers behind OpenRouter with headquarters, data centers and links to their policy and status pages. Use for \"Which providers does OpenRouter route to and where are they based\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_providersArguments","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_current_key":{"post":{"operationId":"get_current_key","summary":"Show the API key used for this call: label, spend today, this week, this month and in total, limit and remaining limit, ","description":"Show the API key used for this call: label, spend today, this week, this month and in total, limit and remaining limit, free-tier flag and rate limit. Use for \"How much have I spent with my OpenRouter key and what is the limit\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_current_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/get_credits":{"post":{"operationId":"get_credits","summary":"Show total credits purchased and total credits used on the account. Needs a management key. Use for \"How many OpenRouter","description":"Show total credits purchased and total credits used on the account. Needs a management key. Use for \"How many OpenRouter credits do I have left\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_creditsArguments","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_activity":{"post":{"operationId":"get_activity","summary":"Show daily usage per model and provider for the last 30 completed UTC days: requests, tokens and spend. Needs a manageme","description":"Show daily usage per model and provider for the last 30 completed UTC days: requests, tokens and spend. Needs a management key. Use for \"Which models did I spend the most on with OpenRouter yesterday\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"date":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only this UTC day within the last 30, as YYYY-MM-DD.","title":"Date"},"api_key_hash":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only usage of the key with this hash.","title":"Api Key Hash"}},"title":"get_activityArguments","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_generation":{"post":{"operationId":"get_generation","summary":"Look up metadata of one past OpenRouter request by its generation id: model, provider, token counts, cost and latency. D","description":"Look up metadata of one past OpenRouter request by its generation id: model, provider, token counts, cost and latency. Does not return prompt text. Use for \"What did OpenRouter generation gen-abc123 cost\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"id":{"description":"Generation id returned with a completion, for example 'gen-1234567890'.","maxLength":200,"title":"Id","type":"string"}},"required":["id"],"title":"get_generationArguments","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}}}}