{"openapi":"3.1.0","info":{"title":"xAI team billing, usage and API key metadata (your management key) API","version":"0.1.0","description":"xAI team billing, usage and API key metadata (your management key) lets an AI assistant read your own xAI Management data through the xAI Management API with a key you supply (xAI management key). Read-only: 8 tools (validate_management_key, list_api_keys, list_endpoint_permissions, get_prepaid_balance, get_postpaid_spending_limits, get_postpaid_invoice_preview, list_invoices, get_usage). The...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-xai-management.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-xai-management/docs"},"termsOfService":"https://connectorbay.com/byok-xai-management/terms"},"servers":[{"url":"https://byok-xai-management.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-xai-management/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/validate_management_key":{"post":{"operationId":"validate_management_key","summary":"Check the management key and show its id, name, scope, owner and permissions (ACLs). The key value itself is never retur","description":"Check the management key and show its id, name, scope, owner and permissions (ACLs). The key value itself is never returned. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"Is my xAI management key valid and what can it do\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"validate_management_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_api_keys":{"post":{"operationId":"list_api_keys","summary":"List the team's API keys (metadata only: id, name, creator, dates, disabled flag, rate limits and permissions; no key va","description":"List the team's API keys (metadata only: id, name, creator, dates, disabled flag, rate limits and permissions; no key value). Admins see all keys, members only their own. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"Which xAI API keys does my team have and are they disabled\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"},"page_size":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"How many keys per page (omit for one single page).","title":"Page Size"},"pagination_token":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null,"description":"Token from the previous answer's paginationToken, for the next page.","title":"Pagination Token"},"active_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to hide expired keys.","title":"Active Only"}},"required":["team_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/list_endpoint_permissions":{"post":{"operationId":"list_endpoint_permissions","summary":"List the endpoint permissions (ACLs) that can be assigned to an API key of the team, with descriptions. Needs a manageme","description":"List the endpoint permissions (ACLs) that can be assigned to an API key of the team, with descriptions. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"Which endpoint permissions can I give an xAI API key\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"}},"required":["team_id"],"title":"list_endpoint_permissionsArguments","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_prepaid_balance":{"post":{"operationId":"get_prepaid_balance","summary":"Get the team's prepaid credit balance: the total and the list of balance changes (purchases, spend, refunds) with status","description":"Get the team's prepaid credit balance: the total and the list of balance changes (purchases, spend, refunds) with status and invoice numbers. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"How much prepaid credit does my xAI team have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"}},"required":["team_id"],"title":"get_prepaid_balanceArguments","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_postpaid_spending_limits":{"post":{"operationId":"get_postpaid_spending_limits","summary":"Get the team's postpaid monthly spending limits: soft limit, automatic hard limit, any override and the limits in effect","description":"Get the team's postpaid monthly spending limits: soft limit, automatic hard limit, any override and the limits in effect. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"What is my xAI team's monthly spending limit\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"}},"required":["team_id"],"title":"get_postpaid_spending_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/get_postpaid_invoice_preview":{"post":{"operationId":"get_postpaid_invoice_preview","summary":"Preview what the team would pay for postpaid usage in the current billing period, with the line items. Needs a managemen","description":"Preview what the team would pay for postpaid usage in the current billing period, with the line items. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"What is my xAI bill so far this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"}},"required":["team_id"],"title":"get_postpaid_invoice_previewArguments","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_invoices":{"post":{"operationId":"list_invoices","summary":"List the team's invoices with number, status, creation time, line items and totals; optionally for one billing month or ","description":"List the team's invoices with number, status, creation time, line items and totals; optionally for one billing month or since a month. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"What xAI invoices has my team received this year\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"},"billing_year":{"anyOf":[{"maximum":2100,"minimum":2023,"type":"integer"},{"type":"null"}],"default":null,"description":"Only the invoice of this billing cycle year (use with billing_month).","title":"Billing Year"},"billing_month":{"anyOf":[{"maximum":12,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only the invoice of this billing cycle month, 1 to 12.","title":"Billing Month"},"since_year":{"anyOf":[{"maximum":2100,"minimum":2023,"type":"integer"},{"type":"null"}],"default":null,"description":"Only invoices since this year (use with since_month).","title":"Since Year"},"since_month":{"anyOf":[{"maximum":12,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only invoices since this month, 1 to 12.","title":"Since Month"}},"required":["team_id"],"title":"list_invoicesArguments","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_usage":{"post":{"operationId":"get_usage","summary":"Get the team's spend over time in US dollars, grouped by what was used (for example model and request type), for a local","description":"Get the team's spend over time in US dollars, grouped by what was used (for example model and request type), for a local date range. Reads analytics only. Needs a management key (not a normal API key). Money amounts are in US cents. Use for \"How much did my xAI team spend per day last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"team_id":{"description":"xAI team id (shown in the xAI Console team settings).","maxLength":64,"title":"Team Id","type":"string"},"start_time":{"description":"Start of the range as 'YYYY-MM-DD HH:MM:SS' in the chosen time zone.","maxLength":30,"title":"Start Time","type":"string"},"end_time":{"description":"End of the range (exclusive) as 'YYYY-MM-DD HH:MM:SS'.","maxLength":30,"title":"End Time","type":"string"},"timezone":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":"Etc/GMT","description":"IANA time zone name for the range, for example 'Etc/GMT' or 'America/New_York'.","title":"Timezone"},"time_unit":{"anyOf":[{"enum":["TIME_UNIT_DAY","TIME_UNIT_MONTH","TIME_UNIT_HOUR","TIME_UNIT_CALENDAR_WEEK"],"type":"string"},{"type":"null"}],"default":"TIME_UNIT_DAY","description":"Bucket size.","title":"Time Unit"}},"required":["team_id","start_time","end_time"],"title":"get_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}}}}