Billing
How a project pays for what it runs. Each project has one payment method, a card, and every resource in it is billed to that card on the project's subscription: a prorated charge when the resource is created, then monthly on the 25th. See [Billing & Payments](/docs/guides/billing-and-payments) for the payment lifecycle and [Pricing](/docs/pricing) for what each product costs. **The biller.** One member holds billing responsibility for the project. Only the biller sees and manages the card, and only the biller can have the project's credit refunded; see [Transfer billing responsibility](/docs/api/members#transfer-billing-responsibility) to hand it to someone else. Any member with write access can create resources, and the charge always goes to the project's card, never to the member's own. **When a create is refused for payment.** A call that creates a billable resource charges the project's card before it answers, and is refused with `402` when it cannot, with nothing created. The `code` says why: `ORG_PAYMENT_METHOD_REQUIRED` — the project has no usable card and the caller is the biller, who adds one and retries; `BILLER_PAYMENT_METHOD_REQUIRED` — the project has no usable card and the caller is not the biller, and `error.details` names the biller (`billerUserId`, `billerName`, `billerEmail`) so they can be asked, which Notify the biller does; `ORG_BILLING_ADDRESS_REQUIRED` — the card's billing address is not complete enough to work out tax, so the card has to be added again with a full address; `PAYMENT_REQUIRED` — the card was declined, or the subscription is past due. A card that has expired, or is not the project's default, does not count as usable. **Credit.** Removing a resource part-way through a billing period credits the unused part to the project's credit balance, which is applied to its next invoices automatically. The biller can instead have the balance refunded to the card or cards that paid it. Payment-processing fees on the original charges cannot be recovered, so the amount refunded is less than the credit it uses up, and credit that cannot be returned to a card stays on the balance. The subscription breakdown, invoices, billing history, credit refunds and the card itself are managed under **Settings → Billing** in the control panel. Invoices and receipts are also emailed to the project's billing email, which Set the billing email changes.
Asks the project's biller, by email and in the control panel, to add a payment method,
naming the caller as the member who asked. Call it after creating a resource is refused
with 402 BILLER_PAYMENT_METHOD_REQUIRED: only the biller can add the card, and nobody
else is ever asked for one.
Any member may call it, whatever their role. For an API key, the caller is the member who
created the key. The biller cannot notify themselves (400), and a repeat request from the
same member for the same project is refused with 429 for a while, so the biller is not
flooded.
Auth: a project API key carrying billing:write.
Rate limit: this endpoint is rate limited; a 429 means back off and retry.
Authorization
apiKey A project API key. X-API-Key: <key> is accepted as an alternative to the Authorization header.
In: header
Path Parameters
1 <= lengthResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/billing/notify-biller"{ "success": true, "data": null}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}{ "success": false, "error": { "code": "string", "message": "string", "details": { "property1": null, "property2": null }, "issues": null, "docsUrl": "http://example.com" }}IAM
AWS access keys for tooling that cannot use a Cosmoner API key — `aws ecr get-login-password`, Kubernetes image pull secrets, S3 clients. These endpoints issue scoped credentials for those cases and list every credential a project has out there. Cosmoner API keys are a different thing and are not listed here; see [API Keys](/docs/guides/api-keys). One credential can reach the project's container registries, its object storage buckets, or both. A grant either names individual repositories and buckets or covers every one in the project, **including those created later**. Each credential's `origin` says which shape it has: `project` is the current one, and `registry` and `bucket` are older single-service shapes that keep working with the scope they were created with. The secret access key is returned once, when the credential is issued, and never stored. Pulls made with these credentials go directly to AWS and are not metered as egress; storage is billed as usual. An API key issuing or re-scoping a credential needs the scopes for what the credential grants as well as `iam:write`, so a key cannot hand out access to buckets or repositories it could not reach itself.
Integrations
Connections to the services a project builds from and pulls images from: GitHub, GitLab and Bitbucket for source code, and Docker Hub and the GitHub container registry for container images. A connection belongs to one project — connecting an account in one project never makes it available in another — and the credentials behind it are stored encrypted and never returned. Connecting is done in the control panel, through each service's own authorization page, or for Docker Hub by entering an access token (a read-only one is enough to deploy). The calls here report on a connection, read what it can see — repositories, branches, configuration files, images and tags — and remove it. A GitHub connection is made of accounts. The project links the Cosmoner GitHub App's installation on each GitHub account or organization that granted it access, and can link several; each grants read access to the repositories chosen on GitHub, and those with the Packages read permission to their container images too. Uninstalling the app on GitHub detaches that account from every project that linked it. While a git service is connected, a push to the branch an app deploys from redeploys the app, as long as its auto-deploy is on. Nothing needs to be called for this. Listing GitHub repositories and browsing a repository's directories are available in the control panel.