{"openapi":"3.1.0","info":{"title":"Lago (BYOK) API","version":"0.1.0","description":"Lago (BYOK) lets an AI assistant read your own Lago data through the Lago API with a key you supply (Lago API key (US cloud cluster)). Read-only: 12 tools (get_organization, list_customers, get_customer, list_subscriptions, list_invoices, get_invoice, list_plans, list_billable_metrics, get_mrr, get_gross_revenue, get_overdue_balance, list_payments). The BYOK key travels with each request, is used...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-lago.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-lago/docs"},"termsOfService":"https://connectorbay.com/byok-lago/terms"},"servers":[{"url":"https://byok-lago.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-lago/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_organization":{"post":{"operationId":"get_organization","summary":"Show your Lago organization: name, country, default currency, timezone, payment terms and invoice numbering mode. Use fo","description":"Show your Lago organization: name, country, default currency, timezone, payment terms and invoice numbering mode. Use for \"Which Lago organization is this key for and what is its default currency\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_organizationArguments","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_customers":{"post":{"operationId":"list_customers","summary":"List billing customers with external id, name, email, currency, country and customer type. Paged. Use for \"Which custome","description":"List billing customers with external id, name, email, currency, country and customer type. Paged. Use for \"Which customers do I have in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search_term":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Match customers whose name, legal name or email contains this text.","title":"Search Term"},"external_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Return only the customer with this external id.","title":"External Id"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_customersArguments","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_customer":{"post":{"operationId":"get_customer","summary":"Get one customer by external id: name, email, currency, country, tax id, payment term and billing configuration. Use for","description":"Get one customer by external id: name, email, currency, country, tax id, payment term and billing configuration. Use for \"Show the Lago customer cus_1001\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"external_customer_id":{"description":"The customer's external id (the identifier your own application gave Lago), for example 'cus_1001'.","maxLength":200,"title":"External Customer Id","type":"string"}},"required":["external_customer_id"],"title":"get_customerArguments","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_subscriptions":{"post":{"operationId":"list_subscriptions","summary":"List subscriptions (active ones unless status is given) with plan code, plan price, status and billing period dates. Use","description":"List subscriptions (active ones unless status is given) with plan code, plan price, status and billing period dates. Use for \"Which subscriptions are active in Lago and on what plans\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"external_customer_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only subscriptions of this customer (external id).","title":"External Customer Id"},"plan_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only subscriptions on the plan with this code.","title":"Plan Code"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_subscriptionsArguments","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 invoices with number, dates, type, status, payment status and totals in cents. Filter by customer, dates, type, ove","description":"List invoices with number, dates, type, status, payment status and totals in cents. Filter by customer, dates, type, overdue state or text. Use for \"Which Lago invoices are overdue\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"external_customer_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only invoices of this customer (external id).","title":"External Customer Id"},"issuing_date_from":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Only invoices issued on or after this date (YYYY-MM-DD).","title":"Issuing Date From"},"issuing_date_to":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Only invoices issued on or before this date (YYYY-MM-DD).","title":"Issuing Date To"},"invoice_type":{"anyOf":[{"enum":["subscription","add_on","credit","one_off","advance_charges","progressive_billing"],"type":"string"},{"type":"null"}],"default":null,"description":"Only this invoice type.","title":"Invoice Type"},"payment_overdue":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only overdue invoices, false for only those not overdue.","title":"Payment Overdue"},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}],"default":null,"description":"Only invoices in this ISO 4217 currency, for example 'USD'.","title":"Currency"},"search_term":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Search invoice id, number, purchase order number or customer name.","title":"Search Term"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"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_invoice":{"post":{"operationId":"get_invoice","summary":"Get one invoice by its Lago id: number, dates, status, payment status and totals in cents. Use for \"Show the details of ","description":"Get one invoice by its Lago id: number, dates, status, payment status and totals in cents. Use for \"Show the details of Lago invoice i1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"lago_id":{"description":"Lago's own invoice id (the lago_id field from list_invoices).","maxLength":200,"title":"Lago Id","type":"string"}},"required":["lago_id"],"title":"get_invoiceArguments","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_plans":{"post":{"operationId":"list_plans","summary":"List pricing plans with code, billing interval, base price, currency, trial period and whether they bill in advance. Use","description":"List pricing plans with code, billing interval, base price, currency, trial period and whether they bill in advance. Use for \"What plans are set up in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_plansArguments","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_billable_metrics":{"post":{"operationId":"list_billable_metrics","summary":"List usage metrics used for pricing: name, code, aggregation type and the field they aggregate. Use for \"Which usage met","description":"List usage metrics used for pricing: name, code, aggregation type and the field they aggregate. Use for \"Which usage metrics are billed in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_billable_metricsArguments","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_mrr":{"post":{"operationId":"get_mrr","summary":"Monthly recurring revenue by month, in cents, from subscription invoices. Use for \"What has our MRR been over the last 6","description":"Monthly recurring revenue by month, in cents, from subscription invoices. Use for \"What has our MRR been over the last 6 months in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}],"default":null,"description":"Three-letter ISO 4217 currency code to restrict the figures to, for example 'EUR'.","title":"Currency"},"billing_entity_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Restrict the figures to one billing entity, by its code. Unknown codes are ignored.","title":"Billing Entity Code"},"months":{"anyOf":[{"maximum":36,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only return data for this many months, counting back from now (1 to 36).","title":"Months"}},"title":"get_mrrArguments","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_gross_revenue":{"post":{"operationId":"get_gross_revenue","summary":"Gross revenue by month in cents (finalized invoices plus paid-in-advance fees), with invoice counts. Can be limited to o","description":"Gross revenue by month in cents (finalized invoices plus paid-in-advance fees), with invoice counts. Can be limited to one customer. Use for \"What was our gross revenue per month this year in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}],"default":null,"description":"Three-letter ISO 4217 currency code to restrict the figures to, for example 'EUR'.","title":"Currency"},"billing_entity_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Restrict the figures to one billing entity, by its code. Unknown codes are ignored.","title":"Billing Entity Code"},"external_customer_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only this customer's revenue (external id).","title":"External Customer Id"},"months":{"anyOf":[{"maximum":36,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only return data for this many months, counting back from now (1 to 36).","title":"Months"}},"title":"get_gross_revenueArguments","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_overdue_balance":{"post":{"operationId":"get_overdue_balance","summary":"Amount still due on invoices past their due date, by month of due date, in cents. Use for \"How much overdue balance do w","description":"Amount still due on invoices past their due date, by month of due date, in cents. Use for \"How much overdue balance do we have in Lago\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}],"default":null,"description":"Three-letter ISO 4217 currency code to restrict the figures to, for example 'EUR'.","title":"Currency"},"billing_entity_code":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Restrict the figures to one billing entity, by its code. Unknown codes are ignored.","title":"Billing Entity Code"},"external_customer_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only this customer's balance (external id).","title":"External Customer Id"},"months":{"anyOf":[{"maximum":36,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only return data for this many months, counting back from now (1 to 36).","title":"Months"}},"title":"get_overdue_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/list_payments":{"post":{"operationId":"list_payments","summary":"List payments recorded against invoices: amount in cents, status, type and payment provider. Filter by customer or invoi","description":"List payments recorded against invoices: amount in cents, status, type and payment provider. Filter by customer or invoice. Use for \"What payments has Lago recorded for cus_1001\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"external_customer_id":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only payments of this customer (external id).","title":"External Customer Id"},"invoice_id":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"Only payments for this Lago invoice id.","title":"Invoice Id"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many records per page (1 to 100).","title":"Per Page"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_paymentsArguments","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}}}}