{"openapi":"3.1.0","info":{"title":"OpenAI moderation, audio, vector storage and code interpreter usage (your key) API","version":"0.1.0","description":"OpenAI moderation, audio, vector storage and code interpreter usage (your key) lets an AI assistant read your own OpenAI Usage Extra data through the OpenAI Usage Extra API with a key you supply (OpenAI Admin API key). Read-only: 5 tools (get_moderations_usage, get_audio_speeches_usage, get_audio_transcriptions_usage, get_vector_stores_usage, get_code_interpreter_usage). The BYOK key travels with...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openai-usage-extra.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openai-usage-extra/docs"},"termsOfService":"https://connectorbay.com/byok-openai-usage-extra/terms"},"servers":[{"url":"https://byok-openai-usage-extra.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openai-usage-extra/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_moderations_usage":{"post":{"operationId":"get_moderations_usage","summary":"Get moderation endpoint usage in time buckets: input tokens and request count, optionally grouped by project, user, API ","description":"Get moderation endpoint usage in time buckets: input tokens and request count, optionally grouped by project, user, API key or model. Needs an Admin API key (sk-admin-...), which only organization owners can create. Reads reports only and runs no model. Use for \"How much did my OpenAI organization use the moderation endpoint 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","user_id","api_key_id","model"],"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_moderations_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_audio_speeches_usage":{"post":{"operationId":"get_audio_speeches_usage","summary":"Get text-to-speech usage in time buckets: characters and request count, optionally grouped by project, user, API key or ","description":"Get text-to-speech usage in time buckets: characters and request count, optionally grouped by project, user, API key or model. Needs an Admin API key (sk-admin-...), which only organization owners can create. Reads reports only and runs no model. Use for \"How many speech characters did my OpenAI organization synthesize this month\".","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","user_id","api_key_id","model"],"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_audio_speeches_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_audio_transcriptions_usage":{"post":{"operationId":"get_audio_transcriptions_usage","summary":"Get speech-to-text usage in time buckets: seconds of audio and request count, optionally grouped by project, user, API k","description":"Get speech-to-text usage in time buckets: seconds of audio and request count, optionally grouped by project, user, API key or model. Needs an Admin API key (sk-admin-...), which only organization owners can create. Reads reports only and runs no model. Use for \"How many seconds of audio did my OpenAI organization transcribe 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","user_id","api_key_id","model"],"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_audio_transcriptions_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_vector_stores_usage":{"post":{"operationId":"get_vector_stores_usage","summary":"Get vector store storage usage in time buckets (bytes), optionally grouped by project. Needs an Admin API key (sk-admin-","description":"Get vector store storage usage in time buckets (bytes), optionally grouped by project. Needs an Admin API key (sk-admin-...), which only organization owners can create. Reads reports only and runs no model. Use for \"How many bytes of vector store storage is my OpenAI organization using per day\".","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":[{"const":"project_id","type":"string"},{"type":"null"}],"default":null,"description":"Optional 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_vector_stores_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_code_interpreter_usage":{"post":{"operationId":"get_code_interpreter_usage","summary":"Get code interpreter session counts in time buckets, optionally grouped by project. Needs an Admin API key (sk-admin-...","description":"Get code interpreter session counts in time buckets, optionally grouped by project. Needs an Admin API key (sk-admin-...), which only organization owners can create. Reads reports only and runs no model. Use for \"How many code interpreter sessions did my OpenAI organization start 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":[{"const":"project_id","type":"string"},{"type":"null"}],"default":null,"description":"Optional 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_code_interpreter_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}}}}