{"openapi":"3.1.0","info":{"title":"OpenAI organization usage, costs and projects (your key) API","version":"0.1.0","description":"OpenAI organization usage, costs and projects (your key) lets an AI assistant read your own OpenAI Admin data through the OpenAI Admin API with a key you supply (OpenAI Admin API key). Read-only: 11 tools (get_completions_usage, get_embeddings_usage, get_images_usage, get_costs, list_projects, get_project, list_project_rate_limits, list_project_service_accounts, list_project_api_keys,...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openai-admin.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openai-admin/docs"},"termsOfService":"https://connectorbay.com/byok-openai-admin/terms"},"servers":[{"url":"https://byok-openai-admin.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openai-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/get_completions_usage":{"post":{"operationId":"get_completions_usage","summary":"Get the organization's text model usage in time buckets: input, cached and output tokens and number of requests, optiona","description":"Get the organization's text model usage in time buckets: input, cached and output tokens and number of requests, optionally grouped by project, model or API key. Reads reports only and runs no model. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"How many tokens did my OpenAI organization use per model this week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_time":{"description":"Start of the range as Unix seconds (inclusive), for example 1760000000.","minimum":0,"title":"Start Time","type":"integer"},"end_time":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Optional end of the range as Unix seconds (exclusive).","title":"End Time"},"bucket_width":{"anyOf":[{"enum":["1d","1h","1m"],"type":"string"},{"type":"null"}],"default":"1d","description":"Bucket size: 1d (default, up to 31 buckets), 1h (up to 168) or 1m (up to 1440).","title":"Bucket Width"},"group_by":{"anyOf":[{"enum":["project_id","model","api_key_id","batch","service_tier"],"type":"string"},{"type":"null"}],"default":null,"description":"Optional single dimension to split usage by.","title":"Group By"},"project_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only usage of this project id.","title":"Project Id"},"model":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only usage of this model name.","title":"Model"},"limit":{"anyOf":[{"maximum":1440,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Number of buckets to return; the default and maximum depend on bucket_width (7 and 31 for 1d).","title":"Limit"},"page":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for the next page: the next_page value of the previous answer.","title":"Page"}},"required":["start_time"],"title":"get_completions_usageArguments","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_embeddings_usage":{"post":{"operationId":"get_embeddings_usage","summary":"Get the organization's embeddings usage in time buckets: input tokens and request count, optionally grouped by project o","description":"Get the organization's embeddings usage in time buckets: input tokens and request count, optionally grouped by project or model. Reads reports only. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"How many embedding tokens did my OpenAI organization use yesterday\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_time":{"description":"Start of the range as Unix seconds (inclusive), for example 1760000000.","minimum":0,"title":"Start Time","type":"integer"},"end_time":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Optional end of the range as Unix seconds (exclusive).","title":"End Time"},"bucket_width":{"anyOf":[{"enum":["1d","1h","1m"],"type":"string"},{"type":"null"}],"default":"1d","description":"Bucket size: 1d (default, up to 31 buckets), 1h (up to 168) or 1m (up to 1440).","title":"Bucket Width"},"group_by":{"anyOf":[{"enum":["project_id","model","api_key_id"],"type":"string"},{"type":"null"}],"default":null,"description":"Optional single dimension to split usage by.","title":"Group By"},"project_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only usage of this project id.","title":"Project Id"},"limit":{"anyOf":[{"maximum":1440,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Number of buckets to return; the default and maximum depend on bucket_width (7 and 31 for 1d).","title":"Limit"},"page":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for the next page: the next_page value of the previous answer.","title":"Page"}},"required":["start_time"],"title":"get_embeddings_usageArguments","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_images_usage":{"post":{"operationId":"get_images_usage","summary":"Get the organization's image generation usage in time buckets: number of images and requests, optionally grouped by size","description":"Get the organization's image generation usage in time buckets: number of images and requests, optionally grouped by size, source or model. Reads reports only. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"How many images did my OpenAI organization generate last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_time":{"description":"Start of the range as Unix seconds (inclusive), for example 1760000000.","minimum":0,"title":"Start Time","type":"integer"},"end_time":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Optional end of the range as Unix seconds (exclusive).","title":"End Time"},"bucket_width":{"anyOf":[{"enum":["1d","1h","1m"],"type":"string"},{"type":"null"}],"default":"1d","description":"Bucket size: 1d (default, up to 31 buckets), 1h (up to 168) or 1m (up to 1440).","title":"Bucket Width"},"group_by":{"anyOf":[{"enum":["project_id","model","size","source","api_key_id"],"type":"string"},{"type":"null"}],"default":null,"description":"Optional single dimension to split usage by.","title":"Group By"},"project_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only usage of this project id.","title":"Project Id"},"limit":{"anyOf":[{"maximum":1440,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Number of buckets to return; the default and maximum depend on bucket_width (7 and 31 for 1d).","title":"Limit"},"page":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for the next page: the next_page value of the previous answer.","title":"Page"}},"required":["start_time"],"title":"get_images_usageArguments","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_costs":{"post":{"operationId":"get_costs","summary":"Get the organization's daily costs in time buckets (amount value and currency per line item), optionally grouped by proj","description":"Get the organization's daily costs in time buckets (amount value and currency per line item), optionally grouped by project or line item. Reads reports only. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"How much did my OpenAI organization spend over the last 30 days\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"start_time":{"description":"Start of the range as Unix seconds (inclusive), for example 1760000000.","minimum":0,"title":"Start Time","type":"integer"},"end_time":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Optional end of the range as Unix seconds (exclusive).","title":"End Time"},"group_by":{"anyOf":[{"enum":["project_id","line_item","api_key_id"],"type":"string"},{"type":"null"}],"default":null,"description":"Optional single dimension to split costs by.","title":"Group By"},"project_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only costs of this project id.","title":"Project Id"},"limit":{"anyOf":[{"maximum":180,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Number of daily buckets to return (1 to 180, default 7).","title":"Limit"},"page":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for the next page: the next_page value of the previous answer.","title":"Page"}},"required":["start_time"],"title":"get_costsArguments","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_projects":{"post":{"operationId":"list_projects","summary":"List the organization's projects with name, status, creation and archive dates and data residency. Needs an Admin API ke","description":"List the organization's projects with name, status, creation and archive dates and data residency. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"What projects does my OpenAI organization have\".","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 objects to return (1 to 100).","title":"Limit"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for paging: the last_id of the previous page.","title":"After"},"include_archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include archived projects.","title":"Include Archived"}},"title":"list_projectsArguments","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_project":{"post":{"operationId":"get_project","summary":"Get one project by id: name, status, dates and data residency. Needs an Admin API key (sk-admin-...), which only organiz","description":"Get one project by id: name, status, dates and data residency. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"Show details of OpenAI project proj_abc123\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project id, for example 'proj_abc123'.","maxLength":100,"title":"Project Id","type":"string"}},"required":["project_id"],"title":"get_projectArguments","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_project_rate_limits":{"post":{"operationId":"list_project_rate_limits","summary":"List the per-model rate limits of one project (requests, tokens, images and audio per minute, daily limits). Needs an Ad","description":"List the per-model rate limits of one project (requests, tokens, images and audio per minute, daily limits). Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"What are the rate limits of OpenAI project proj_abc123\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project id, for example 'proj_abc123'.","maxLength":100,"title":"Project Id","type":"string"},"limit":{"anyOf":[{"maximum":500,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many objects to return (default 100).","title":"Limit"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for paging: the last_id of the previous page.","title":"After"}},"required":["project_id"],"title":"list_project_rate_limitsArguments","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_project_service_accounts":{"post":{"operationId":"list_project_service_accounts","summary":"List the service accounts of one project with name, role and creation date. No credentials are returned. Needs an Admin ","description":"List the service accounts of one project with name, role and creation date. No credentials are returned. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"Which service accounts exist in OpenAI project proj_abc123\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project id, for example 'proj_abc123'.","maxLength":100,"title":"Project Id","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many objects to return (1 to 100).","title":"Limit"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for paging: the last_id of the previous page.","title":"After"}},"required":["project_id"],"title":"list_project_service_accountsArguments","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_project_api_keys":{"post":{"operationId":"list_project_api_keys","summary":"List the API keys of one project (metadata only: id, name, creation and last-used time, whether the owner still has acce","description":"List the API keys of one project (metadata only: id, name, creation and last-used time, whether the owner still has access; no key value is returned). Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"When were the API keys of OpenAI project proj_abc123 last used\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"project_id":{"description":"Project id, for example 'proj_abc123'.","maxLength":100,"title":"Project Id","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many objects to return (1 to 100).","title":"Limit"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for paging: the last_id of the previous page.","title":"After"},"owner_project_access":{"anyOf":[{"enum":["active","inactive","any"],"type":"string"},{"type":"null"}],"default":null,"description":"Only keys whose owner currently has active or inactive access to the project.","title":"Owner Project Access"}},"required":["project_id"],"title":"list_project_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/list_spend_alerts":{"post":{"operationId":"list_spend_alerts","summary":"List the organization's spend alerts: threshold amount, currency and interval. Needs an Admin API key (sk-admin-...), wh","description":"List the organization's spend alerts: threshold amount, currency and interval. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"What spend alerts are set on my OpenAI organization\".","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 alerts to return (1 to 100, default 20).","title":"Limit"},"order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"asc","description":"Sort order by creation: asc or desc.","title":"Order"},"after":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Cursor for paging: the id of the last alert of the previous page.","title":"After"}},"title":"list_spend_alertsArguments","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_spend_limit":{"post":{"operationId":"get_spend_limit","summary":"Get the organization's hard spend limit: threshold amount, currency, interval and enforcement status. Needs an Admin API","description":"Get the organization's hard spend limit: threshold amount, currency, interval and enforcement status. Needs an Admin API key (sk-admin-...), which only organization owners can create. Use for \"What is my OpenAI organization's monthly spend limit\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_spend_limitArguments","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}}}}