{"openapi":"3.1.0","info":{"title":"AIMLAPI (BYOK) API","version":"0.1.0","description":"AIMLAPI (BYOK) lets an AI assistant read your own AIMLAPI data through the AIMLAPI API with a key you supply (AI/ML API key). Read-only: 7 tools (get_balance, get_billing_detail, list_transactions, get_key_usage, get_key_usage_detail, list_usage_logs, list_models). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is only ever sent to...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-aimlapi.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-aimlapi/docs"},"termsOfService":"https://connectorbay.com/byok-aimlapi/terms"},"servers":[{"url":"https://byok-aimlapi.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-aimlapi/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_balance":{"post":{"operationId":"get_balance","summary":"Show the account's current balance and currency. Use for \"How much AI/ML API balance do I have\".","description":"Show the account's current balance and currency. Use for \"How much AI/ML API balance do I have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_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_billing_detail":{"post":{"operationId":"get_billing_detail","summary":"Show the account balance with auto top-up settings (enabled flag, threshold, amount). Use for \"Is auto top-up enabled on","description":"Show the account balance with auto top-up settings (enabled flag, threshold, amount). Use for \"Is auto top-up enabled on my AI/ML API account\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_billing_detailArguments","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_transactions":{"post":{"operationId":"list_transactions","summary":"List account ledger entries (top-ups and charges) newest first, with type, amount in USD and credits, and model; page wi","description":"List account ledger entries (top-ups and charges) newest first, with type, amount in USD and credits, and model; page with the cursor. Use for \"What were my latest AI/ML API charges\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"from_time":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only entries at or after this ISO 8601 time with an offset.","title":"From Time"},"to":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only entries before this ISO 8601 time with an offset; must be later than from.","title":"To"},"direction":{"anyOf":[{"enum":["TOPUP","CHARGE"],"type":"string"},{"type":"null"}],"default":null,"description":"TOPUP for money in, CHARGE for money out.","title":"Direction"},"type":{"anyOf":[{"enum":["PAYMENT","BONUS","REFUND","ADJUSTMENT","MODEL_USAGE","CREDITS_EXPIRED","INIT"],"type":"string"},{"type":"null"}],"default":null,"description":"Only entries of this kind.","title":"Type"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"Entries per page (1 to 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"pagination.next_cursor from the previous answer, passed back unchanged.","title":"Cursor"}},"title":"list_transactionsArguments","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_key_usage":{"post":{"operationId":"get_key_usage","summary":"Show total spend and request count of the calling key over a time window. Use for \"How much did my AI/ML API key spend i","description":"Show total spend and request count of the calling key over a time window. Use for \"How much did my AI/ML API key spend in the last 7 days\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"period":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Relative window: a positive integer followed by h or d, for example 24h or 7d. Use either period or start with end.","title":"Period"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window start, ISO 8601 (read as UTC without an offset); use together with end.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window end, ISO 8601; the window must not exceed 92 days.","title":"End"}},"title":"get_key_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_key_usage_detail":{"post":{"operationId":"get_key_usage_detail","summary":"Show spend and requests of the calling key per model, optionally grouped per day, per model or both. Use for \"Break down","description":"Show spend and requests of the calling key per model, optionally grouped per day, per model or both. Use for \"Break down my AI/ML API spend per model for the last 30 days\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"period":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Relative window: a positive integer followed by h or d, for example 24h or 7d. Use either period or start with end.","title":"Period"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window start, ISO 8601 (read as UTC without an offset); use together with end.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window end, ISO 8601; the window must not exceed 92 days.","title":"End"},"group_by":{"anyOf":[{"enum":["day","model","day,model"],"type":"string"},{"type":"null"}],"default":null,"description":"Add a groups array grouped by day, model or day,model.","title":"Group By"},"tz":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"IANA time zone for day boundaries when grouping by day, for example Europe/Berlin.","title":"Tz"}},"title":"get_key_usage_detailArguments","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_usage_logs":{"post":{"operationId":"list_usage_logs","summary":"List individual requests made with the calling key: model, status, cost in USD and credits, and token counts; page with ","description":"List individual requests made with the calling key: model, status, cost in USD and credits, and token counts; page with limit and offset. Use for \"Show my failed AI/ML API requests from the last day\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"period":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Relative window: a positive integer followed by h or d, for example 24h or 7d. Use either period or start with end.","title":"Period"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window start, ISO 8601 (read as UTC without an offset); use together with end.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Window end, ISO 8601; the window must not exceed 92 days.","title":"End"},"model":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only requests to this model, as 'source/alias' or a bare alias.","title":"Model"},"status":{"anyOf":[{"enum":["succeeded","failed"],"type":"string"},{"type":"null"}],"default":null,"description":"Only requests with this outcome.","title":"Status"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"Rows per page (1 to 100).","title":"Limit"},"offset":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Rows to skip.","title":"Offset"}},"title":"list_usage_logsArguments","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_models":{"post":{"operationId":"list_models","summary":"List models with type, tags, context length and, when requested, pricing, modalities and capabilities; supports several ","description":"List models with type, tags, context length and, when requested, pricing, modalities and capabilities; supports several filters. Use for \"Which AI/ML API models can generate video and what do they cost\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"include":{"anyOf":[{"enum":["pricing","modalities","capabilities","all"],"type":"string"},{"type":"null"}],"default":null,"description":"Optional sections to attach: pricing, modalities, capabilities, or all.","title":"Include"},"id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only models with this id or alias.","title":"Id"},"type":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only models served through this endpoint type, for example openai/chat-completions.","title":"Type"},"tags":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only models with this tag, for example playground:video.","title":"Tags"},"output_modalities":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Only models producing this output modality, for example video.","title":"Output Modalities"},"capabilities":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only models declaring this capability, for example image_to_video.","title":"Capabilities"}},"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}}}}