{"openapi":"3.1.0","info":{"title":"Portkey (BYOK) API","version":"0.1.0","description":"Portkey (BYOK) lets an AI assistant read your own Portkey data through the Portkey API with a key you supply (Portkey API key). Read-only: 10 tools (list_prompts, list_configs, list_virtual_keys, list_guardrails, list_integrations, list_workspaces, get_requests_graph, get_cost_graph, get_tokens_graph, get_latency_graph). The BYOK key travels with each request, is used for that one call only and...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-portkey.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-portkey/docs"},"termsOfService":"https://connectorbay.com/byok-portkey/terms"},"servers":[{"url":"https://byok-portkey.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-portkey/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_prompts":{"post":{"operationId":"list_prompts","summary":"List saved prompt templates with slug, model, status and update time, optionally by collection, workspace or search text","description":"List saved prompt templates with slug, model, status and update time, optionally by collection, workspace or search text. Use for \"Which prompt templates are saved in my Portkey workspace\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"collection_id":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Only prompts in this collection ID.","title":"Collection Id"},"workspace_id":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this workspace ID (needed with an organization key; a workspace key is limited to its own workspace).","title":"Workspace Id"},"search":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only prompts whose name matches this text.","title":"Search"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many items per page (1 to 100).","title":"Page Size"},"current_page":{"anyOf":[{"maximum":10000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Current Page"}},"title":"list_promptsArguments","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_configs":{"post":{"operationId":"list_configs","summary":"List gateway configs (routing, fallback and cache setups) with slug, status and update time. Use for \"What Portkey gatew","description":"List gateway configs (routing, fallback and cache setups) with slug, status and update time. Use for \"What Portkey gateway configs exist\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_configsArguments","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_virtual_keys":{"post":{"operationId":"list_virtual_keys","summary":"List virtual keys with status, usage limit, rate limits and expiry (the provider secrets are never returned). Use for \"W","description":"List virtual keys with status, usage limit, rate limits and expiry (the provider secrets are never returned). Use for \"Which Portkey virtual keys are active and what are their limits\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"current_page":{"description":"Page number, starting at 0.","maximum":10000,"minimum":0,"title":"Current Page","type":"integer"},"page_size":{"description":"How many keys per page (1 to 100).","maximum":100,"minimum":1,"title":"Page Size","type":"integer"}},"required":["current_page","page_size"],"title":"list_virtual_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_guardrails":{"post":{"operationId":"list_guardrails","summary":"List guardrails with target, status, owner and update time, for a workspace or the organization. Use for \"Which Portkey ","description":"List guardrails with target, status, owner and update time, for a workspace or the organization. Use for \"Which Portkey guardrails are active\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"workspace_id":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this workspace ID (needed with an organization key; a workspace key is limited to its own workspace).","title":"Workspace Id"},"organisation_id":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Organization ID to list organization-level guardrails for.","title":"Organisation Id"},"page_size":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many guardrails per page (1 to 1000).","title":"Page Size"},"current_page":{"anyOf":[{"maximum":10000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Current Page"}},"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/list_integrations":{"post":{"operationId":"list_integrations","summary":"List provider integrations (connections to LLM providers) with slug, status and creation time. Use for \"Which LLM provid","description":"List provider integrations (connections to LLM providers) with slug, status and creation time. Use for \"Which LLM provider integrations are set up in Portkey\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"workspace_id":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Only items of this workspace ID (needed with an organization key; a workspace key is limited to its own workspace).","title":"Workspace Id"},"type":{"anyOf":[{"enum":["workspace","organisation","all"],"type":"string"},{"type":"null"}],"default":"all","description":"Scope: workspace, organisation or all.","title":"Type"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many items per page (1 to 100).","title":"Page Size"},"current_page":{"anyOf":[{"maximum":10000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Current Page"}},"title":"list_integrationsArguments","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 slug, description, usage limits and rate limits. Needs an organization-level admin key. Use for \"Wh","description":"List workspaces with slug, description, usage limits and rate limits. Needs an organization-level admin key. Use for \"What workspaces does my Portkey organization have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only workspaces whose name contains this text.","title":"Name"},"status":{"anyOf":[{"enum":["active","archived"],"type":"string"},{"type":"null"}],"default":null,"description":"Only active or archived workspaces.","title":"Status"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many items per page (1 to 100).","title":"Page Size"},"current_page":{"anyOf":[{"maximum":10000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Current Page"}},"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_requests_graph":{"post":{"operationId":"get_requests_graph","summary":"Get the number of gateway requests over time for a period as time buckets with a summary total, from the Portkey analyti","description":"Get the number of gateway requests over time for a period as time buckets with a summary total, from the Portkey analytics API. Admin-level key needed. Use for \"How many LLM requests went through Portkey last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"time_of_generation_min":{"description":"Start of the period, ISO 8601 with offset, for example 2026-10-01T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Min","type":"string"},"time_of_generation_max":{"description":"End of the period, ISO 8601 with offset, for example 2026-10-08T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Max","type":"string"},"workspace_slug":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Workspace slug to report on; ignored for a workspace key, and the default workspace is used if left empty with an organization key.","title":"Workspace Slug"},"status_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests with these HTTP status codes (comma-separated, for example '200,429').","title":"Status Code"},"ai_org_model":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests for these provider and model pairs, comma-separated, each as provider__model, for example 'openai__gpt-4o,azure-openai__gpt-35-turbo'.","title":"Ai Org Model"}},"required":["time_of_generation_min","time_of_generation_max"],"title":"get_requests_graphArguments","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_cost_graph":{"post":{"operationId":"get_cost_graph","summary":"Get the cost of gateway requests (total and average per request) over time for a period as time buckets with a summary t","description":"Get the cost of gateway requests (total and average per request) over time for a period as time buckets with a summary total, from the Portkey analytics API. Admin-level key needed. Use for \"How much did my LLM traffic cost last week according to Portkey\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"time_of_generation_min":{"description":"Start of the period, ISO 8601 with offset, for example 2026-10-01T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Min","type":"string"},"time_of_generation_max":{"description":"End of the period, ISO 8601 with offset, for example 2026-10-08T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Max","type":"string"},"workspace_slug":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Workspace slug to report on; ignored for a workspace key, and the default workspace is used if left empty with an organization key.","title":"Workspace Slug"},"status_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests with these HTTP status codes (comma-separated, for example '200,429').","title":"Status Code"},"ai_org_model":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests for these provider and model pairs, comma-separated, each as provider__model, for example 'openai__gpt-4o,azure-openai__gpt-35-turbo'.","title":"Ai Org Model"}},"required":["time_of_generation_min","time_of_generation_max"],"title":"get_cost_graphArguments","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_tokens_graph":{"post":{"operationId":"get_tokens_graph","summary":"Get the token usage (total and average per request) over time for a period as time buckets with a summary total, from th","description":"Get the token usage (total and average per request) over time for a period as time buckets with a summary total, from the Portkey analytics API. Admin-level key needed. Use for \"How many tokens did my Portkey traffic use last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"time_of_generation_min":{"description":"Start of the period, ISO 8601 with offset, for example 2026-10-01T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Min","type":"string"},"time_of_generation_max":{"description":"End of the period, ISO 8601 with offset, for example 2026-10-08T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Max","type":"string"},"workspace_slug":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Workspace slug to report on; ignored for a workspace key, and the default workspace is used if left empty with an organization key.","title":"Workspace Slug"},"status_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests with these HTTP status codes (comma-separated, for example '200,429').","title":"Status Code"},"ai_org_model":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests for these provider and model pairs, comma-separated, each as provider__model, for example 'openai__gpt-4o,azure-openai__gpt-35-turbo'.","title":"Ai Org Model"}},"required":["time_of_generation_min","time_of_generation_max"],"title":"get_tokens_graphArguments","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_latency_graph":{"post":{"operationId":"get_latency_graph","summary":"Get request latency in milliseconds (average, p50, p90, p99) over time for a period as time buckets with a summary total","description":"Get request latency in milliseconds (average, p50, p90, p99) over time for a period as time buckets with a summary total, from the Portkey analytics API. Admin-level key needed. Use for \"What was my p99 LLM latency in Portkey last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"time_of_generation_min":{"description":"Start of the period, ISO 8601 with offset, for example 2026-10-01T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Min","type":"string"},"time_of_generation_max":{"description":"End of the period, ISO 8601 with offset, for example 2026-10-08T00:00:00+00:00.","maxLength":40,"title":"Time Of Generation Max","type":"string"},"workspace_slug":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Workspace slug to report on; ignored for a workspace key, and the default workspace is used if left empty with an organization key.","title":"Workspace Slug"},"status_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests with these HTTP status codes (comma-separated, for example '200,429').","title":"Status Code"},"ai_org_model":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests for these provider and model pairs, comma-separated, each as provider__model, for example 'openai__gpt-4o,azure-openai__gpt-35-turbo'.","title":"Ai Org Model"}},"required":["time_of_generation_min","time_of_generation_max"],"title":"get_latency_graphArguments","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}}}}