{"openapi":"3.0.1","info":{"description":"The Cloud Billing API enables you to retrieve cost and usage information.","title":"Cloud Billing API","version":"1.0.0"},"servers":[{"url":"https://cloud.elastic.co","description":"Public"}],"tags":[{"name":"Azure Marketplace","description":"The Azure Marketplace API is used to manage the Azure marketplace details."},{"name":"AWS Marketplace","description":"The AWS Marketplace API is used to manage the AWS marketplace details."},{"name":"GCP Marketplace","description":"The GCP Marketplace API is used to manage the GCP marketplace details."},{"name":"Heroku","description":"The Heroku API is used to manage the Heroku marketplace details."},{"name":"Billing Accounts","description":"The billing accounts API is used to manage the billing accounts details."},{"name":"Billing Costs Analysis","description":"The billing costs analysis API is used to manage the billing costs analysis details."},{"name":"Billing Organization","description":"The billing organization API is used to manage the billing organization details."},{"name":"Billing Charts","description":"The billing charts API is used to manage the billing charts details."},{"name":"Budgets","description":"The budgets API is used to manage the budgets details."},{"name":"Metering","description":"The metering API is used to manage the metering details."},{"name":"Prices","description":"The prices API is used to manage the prices details."},{"name":"Line Items","description":"The line items API is used to manage the line items details."},{"name":"Util Functions","description":"The util functions API is used to manage the util functions details."}],"paths":{"/api/v1/billing/organization/{organization_id}/budget":{"post":{"description":"Create a new budget for an organization","operationId":"createBudgetV1","parameters":[{"description":"The organization ID","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"default":true,"description":"Whether the budget is active","type":"boolean"},"alerts":{"description":"List of budget alerts. The service enforces a server-side limit on the number of alerts per budget.","items":{"properties":{"operator":{"description":"Alert operator","enum":["gte","lte"],"type":"string"},"threshold":{"description":"Alert threshold value","type":"integer"},"threshold_type":{"description":"Whether threshold is a percentage or absolute amount","enum":["percentage","amount"],"type":"string"}},"required":["operator","threshold","threshold_type"],"type":"object"},"type":"array"},"amount":{"description":"Budget amount in ECU","type":"integer"},"name":{"description":"Optional name for the budget","type":"string"},"period":{"description":"Budget period","enum":["monthly"],"type":"string"},"recipient_group":{"description":"Optional list of recipient types who receive budget alerts (organization-admins, billing-admins, resource-viewers, resource-editors, resource-admins). resource-viewers, resource-editors and resource-admins cannot be used with scope_type=organization. organization-admins, billing-admins are included by default if recipient_group is not provided.","items":{"enum":["organization-admins","billing-admins","resource-viewers","resource-editors","resource-admins"],"type":"string"},"type":"array"},"scope_type":{"description":"The scope type of the budget","enum":["organization","cloud_resource"],"type":"string"},"scope_values":{"description":"List of scope values","items":{"type":"string"},"type":"array"}},"required":["scope_type","scope_values","amount","period","alerts"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"id":432433423},"schema":{"properties":{"id":{"description":"The created budget ID","type":"integer"}},"type":"object"}}},"description":"Budget created successfully"},"400":{"description":"Invalid request"},"403":{"description":"Not allowed to create this budget"},"500":{"description":"Internal Server Error"}},"summary":"Create a budget for the organization.","tags":["Budgets"]}},"/api/v1/billing/organization/{organization_id}/budget/{budget_id}":{"post":{"description":"Update an organization's existing budget","operationId":"updateBudgetV1","parameters":[{"description":"The organization ID","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"The budget ID","in":"path","name":"budget_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"active":{"default":true,"description":"Whether the budget is active","type":"boolean"},"alerts":{"description":"List of budget alerts. The service enforces a server-side limit on the number of alerts per budget.","items":{"properties":{"operator":{"description":"Alert operator","enum":["gte","lte"],"type":"string"},"threshold":{"description":"Alert threshold value","type":"integer"},"threshold_type":{"description":"Whether threshold is a percentage or absolute amount","enum":["percentage","amount"],"type":"string"}},"required":["operator","threshold","threshold_type"],"type":"object"},"type":"array"},"amount":{"description":"Budget amount in ECU","type":"integer"},"name":{"description":"Optional name for the budget","type":"string"},"period":{"description":"Budget period","enum":["monthly"],"type":"string"},"recipient_group":{"description":"Optional list of recipient types who receive budget alerts (organization-admins, billing-admins, resource-viewers, resource-editors, resource-admins). resource-viewers, resource-editors and resource-admins cannot be used with scope_type=organization.","items":{"enum":["organization-admins","billing-admins","resource-viewers","resource-editors","resource-admins"],"type":"string"},"type":"array"},"scope_type":{"description":"The scope type of the budget","enum":["organization","cloud_resource"],"type":"string"},"scope_values":{"description":"List of scope values","items":{"type":"string"},"type":"array"}},"required":["scope_type","scope_values","amount","period","alerts"],"type":"object"}}},"required":true},"responses":{"204":{"description":"Budget updated successfully"},"400":{"description":"Invalid request"},"403":{"description":"Not allowed to update this budget"},"404":{"description":"Budget not found"},"500":{"description":"Internal Server Error"}},"summary":"Update a budget for the organization.","tags":["Budgets"]}},"/api/v1/billing/organization/{organization_id}/budgets":{"get":{"description":"Retrieves budgets for the specified organization. Admins receive all budgets; non-admins receive only budgets scoped to cloud resources they can access.","operationId":"listBudgetsV1","parameters":[{"description":"The organization ID","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Budget"},"type":"array"}}},"description":"Budgets successfully retrieved"},"500":{"description":"Internal server error (error_getting_budgets, error_fetching_cloud_resources)"}},"summary":"List budgets for the organization.","tags":["Budgets"]}},"/api/v1/billing/organization/{organization_id}/budgets/{budget_id}":{"delete":{"description":"Deletes the budget for the specified organization. Admins may delete any budget. Non-admins may delete only cloud-resource-scoped budgets for which they have update access on all scoped resources.","operationId":"deleteBudgetV1","parameters":[{"description":"The organization ID","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"The budget ID","in":"path","name":"budget_id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Budget successfully deleted"},"403":{"description":"Not allowed to delete this budget"},"404":{"description":"Budget not found"},"500":{"description":"Internal server error"}},"summary":"Delete a budget for the organization.","tags":["Budgets"]},"get":{"description":"Retrieves a budget for the specified organization. Admins receive any budget in the organization. Non-admins receive organization-scoped budgets with 403 Forbidden; cloud-resource-scoped budgets are returned only when all scope values are instances they can access, otherwise 403 Forbidden.","operationId":"getBudgetV1","parameters":[{"description":"The organization ID","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"The budget ID","in":"path","name":"budget_id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Budget"}}},"description":"Budget successfully retrieved"},"403":{"description":"Not allowed to read this budget"},"404":{"description":"Budget not found"},"500":{"description":"Internal server error"}},"summary":"Get a budget for the organization.","tags":["Budgets"]}},"/api/v1/billing/organization/{organization_id}/history":{"get":{"description":"Retrieves the billing statement and invoice history for the organization, including statement periods, amounts, statuses, and PDF download links when available.","operationId":"getHistoryV1","parameters":[{"in":"path","name":"organization_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"invoices":[{"invoiced_amount_in_cents":0,"issue_date":"2022-05-01","number":1,"organization_id":"1","period_end_date":"2022-05-31","period_start_date":"2022-05-01","status":"paid","type":"invoice"}],"statements":[]},"schema":{"properties":{"invoices":{"items":{"properties":{"external_invoice_pdf_download":{"type":"string"},"invoice_pdf_download":{"type":"string"},"invoiced_amount_in_cents":{"type":"integer"},"issue_date":{"format":"date","type":"string"},"number":{"type":"integer"},"organization_id":{"type":"string"},"payment_metadata":{"properties":{"amount":{"type":"number"},"currency":{"type":"string"},"external_invoice_id":{"type":"string"}},"type":"object"},"period_end_date":{"format":"date","type":"string"},"period_start_date":{"format":"date","type":"string"},"status":{"type":"string"},"type":{"type":"string"}},"required":["number","organization_id","period_start_date","period_end_date","issue_date","type","status","invoiced_amount_in_cents"],"type":"object"},"type":"array"},"statements":{"items":{"properties":{"currency":{"type":"string"},"ecu_total":{"type":"integer"},"external_invoice_pdf_download":{"description":"Presigned S3 URL for the externally generated (e.g. Recurly) invoice PDF. Present only when that PDF exists in S3.\n","type":"string"},"invoiced_amount_in_cents":{"type":"integer"},"issue_date":{"type":"string"},"number":{"type":"string"},"organization_id":{"type":"string"},"payment_metadata":{"description":"Present only when payment details exist (e.g. Recurly details for direct monthly CC statements).\n","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"external_invoice_id":{"type":"string"}},"type":"object"},"period_end_date":{"type":"string"},"period_start_date":{"type":"string"},"reseller":{"type":"boolean"},"status":{"type":"string"},"type":{"type":"string"},"usage_pdf_download":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Successful fetched billing history."},"401":{"content":{"text/plain":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}},"description":"Access token is missing or invalid"},"404":{"description":"Not found."},"500":{"description":"Internal Server Error."}},"summary":"Get the billing history for the organization.","tags":["Billing Organization"]}},"/api/v2/billing/organizations/{organization_id}/charts":{"get":{"description":"Retrieves the usage charts for the organization.\nAdmin callers receive all instances; non-admin user callers receive\ndata filtered to the instances they have access to (empty buckets if\nnone).\n","operationId":"getChartsV2","parameters":[{"in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"A datetime for the beginning of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A datetime for the end of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"The desired bucketing strategy for the charts.","in":"query","name":"bucketing_strategy","required":false,"schema":{"enum":["daily","monthly"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"The list of chart item.","items":{"properties":{"timestamp":{"description":"Axis X position.","format":"int64","type":"integer"},"values":{"description":"The collection of values to plot the chart item.","items":{"properties":{"id":{"description":"The id of chart item value.","type":"string"},"name":{"description":"The name of the chart item value.","type":"string"},"type":{"description":"Item type.","type":"string"},"value":{"description":"The actual value of the chart item value.","format":"double","type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Successfully return the usage charts of an organization."},"401":{"content":{"text/plain":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}},"description":"Unauthorized"},"404":{"description":"Not found."},"424":{"description":"Failed dependency."},"500":{"description":"Internal Server Error."}},"summary":"Get the usage charts for the organization.","tags":["Billing Charts"]}},"/api/v2/billing/organizations/{organization_id}/costs/instances":{"get":{"description":"Retrieves costs associated with all instances for the organization.\nAdmin callers receive all instances; non-admin user callers receive\ndata filtered to the instances they have access to (empty result if\nnone).\n","operationId":"getCostsByInstancesV2","parameters":[{"description":"Identifier for the organization","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"A datetime for the beginning of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A datetime for the end of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"Specifies whether to include project names in the result by querying the control plane","in":"query","name":"include_names","required":false,"schema":{"type":"boolean"}},{"description":"Determines the response body format. Can be either application/json or text/csv.","in":"header","name":"Accept","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instances"}}},"description":"Success. The costs associated to a set of instances."},"400":{"description":"The specified data range is invalid."},"403":{"description":"Current user does not have access to the requested organization."},"404":{"description":"Organization not found."},"500":{"description":"Internal server error."}},"summary":"Get instances costs for the organization.","tags":["Billing Costs Analysis"]}},"/api/v2/billing/organizations/{organization_id}/costs/instances/{instance_id}/items":{"get":{"description":"Retrieves the costs associated to a set of items billed for a single instance.\nAdmin callers receive the data unconditionally; non-admin user callers\nreceive 403 if the instance is not in their accessible cloud resources.\n","operationId":"getItemizedCostsByInstanceV2","parameters":[{"description":"Identifier for the organization","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"Identifier for the instance","in":"path","name":"instance_id","required":true,"schema":{"type":"string"}},{"description":"A datetime for the beginning of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A datetime for the end of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"Determines the response body format. Can be either application/json or text/csv.","in":"header","name":"Accept","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Items"}}},"description":"Success. The costs associated to a set of items billed for a single instance."},"400":{"description":"The specified data range is invalid."},"403":{"description":"Current user does not have access to the requested organization,\nor (for non-admin callers) does not have access to the requested\ninstance.\n"},"404":{"description":"Organization not found."},"500":{"description":"Internal server error."}},"summary":"Get itemized costs by instance for the organization.","tags":["Billing Costs Analysis"]}},"/api/v2/billing/organizations/{organization_id}/costs/items":{"get":{"description":"Retrieves costs associated with all items for the organization.\nAdmin callers receive all items; non-admin user callers are\nfiltered to items billed against instances they have access to.\n","operationId":"getCostsByItemsV2","parameters":[{"description":"Identifier for the organization","in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"description":"A datetime for the beginning of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A datetime for the end of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"How to group the serverless items.","in":"query","name":"serverless_group_by","required":false,"schema":{"enum":["product","product_family"],"type":"string"}},{"description":"Determines the response body format. Can be either application/json or text/csv.","in":"header","name":"Accept","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Items"}}},"description":"Success. The costs associated to a set of items."},"400":{"description":"The specified data range is invalid."},"403":{"description":"Current user does not have access to the requested organization."},"404":{"description":"Organization not found."},"500":{"description":"Internal server error."}},"summary":"Get itemized costs for the organization.","tags":["Billing Costs Analysis"]}},"/api/v2/billing/organizations/{organization_id}/instances/{instance_id}/charts":{"get":{"description":"Retrieves the usage charts for the organization's instance.\nAdmin callers receive the data unconditionally; non-admin user callers\nreceive 403 if the instance is not in their accessible cloud resources.\n","operationId":"getChartsByInstanceV2","parameters":[{"in":"path","name":"organization_id","required":true,"schema":{"type":"string"}},{"in":"path","name":"instance_id","required":true,"schema":{"type":"string"}},{"description":"A datetime for the beginning of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A datetime for the end of the desired range.","example":"2021-04-21T00:00:00+00:00","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"The desired bucketing strategy for the charts.","in":"query","name":"bucketing_strategy","required":false,"schema":{"enum":["daily","monthly"],"type":"string"}},{"description":"The type of the instances to be returned.","in":"query","name":"instance_type","required":false,"schema":{"enum":["all","deployments","projects"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"The list of chart item.","items":{"properties":{"timestamp":{"description":"Axis X position.","format":"int64","type":"integer"},"values":{"description":"The collection of values to plot the chart item.","items":{"properties":{"id":{"description":"The id of chart item value.","type":"string"},"name":{"description":"The name of the chart item value.","type":"string"},"type":{"description":"Item type.","type":"string"},"value":{"description":"The actual value of the chart item value.","format":"double","type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"Successfully return the usage charts of an organization's instance."},"401":{"content":{"text/plain":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}},"description":"Unauthorized"},"403":{"description":"Caller does not have access to the requested instance."},"404":{"description":"Not found."},"424":{"description":"Failed dependency."},"500":{"description":"Internal Server Error."}},"summary":"Get the usage charts for the instance of an organization.","tags":["Billing Charts"]}}},"components":{"schemas":{"Budget":{"description":"Budget(id: 'int', scope_type: '_types.ScopeType', scope_values: 'list[str]', amount: 'int', period: '_types.Period', name: 'str | None', active: 'bool', created_at: 'str | None', alerts: 'list[BudgetAlert]', recipient_group: 'list[_types.RecipientType]')","properties":{"active":{"type":"boolean"},"alerts":{"items":{"$ref":"#/components/schemas/BudgetAlert"},"type":"array"},"amount":{"type":"integer"},"created_at":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"},"period":{"enum":["monthly"],"type":"string","x-enum-name":"Period","x-module-name":"cloud.costs_alerting._types"},"recipient_group":{"items":{"enum":["organization-admins","billing-admins","resource-viewers","resource-editors","resource-admins"],"type":"string","x-enum-name":"RecipientType","x-module-name":"cloud.costs_alerting._types"},"type":"array"},"scope_type":{"enum":["organization","cloud_resource"],"type":"string","x-enum-name":"ScopeType","x-module-name":"cloud.costs_alerting._types"},"scope_values":{"items":{"type":"string"},"type":"array"}},"required":["id","scope_type","scope_values","amount","period","active","alerts","recipient_group"],"type":"object","x-module-name":"cloud.billing_service.apps.budgets.api.schema"},"BudgetAlert":{"description":"BudgetAlert(id: 'int', operator: '_types.Operator', threshold: 'int', threshold_type: '_types.ThresholdType', created_at: 'str | None', last_exceeded_at: 'str | None')","properties":{"created_at":{"type":"string"},"id":{"type":"integer"},"last_exceeded_at":{"type":"string"},"operator":{"enum":["gte","lte"],"type":"string","x-enum-name":"Operator","x-module-name":"cloud.costs_alerting._types"},"threshold":{"type":"integer"},"threshold_type":{"enum":["percentage","amount"],"type":"string","x-enum-name":"ThresholdType","x-module-name":"cloud.costs_alerting._types"}},"required":["id","operator","threshold","threshold_type"],"type":"object","x-module-name":"cloud.billing_service.apps.budgets.api.schema"},"DisplayQuantity":{"description":"Display quantity","properties":{"formatted_value":{"type":"string"},"type":{"enum":["default","normalized"],"type":"string","x-enum-name":"DisplayQuantityType","x-module-name":"cloud.costs.v2"},"value":{"oneOf":[{"type":"integer"},{"type":"number"}]}},"required":["value","formatted_value","type"],"type":"object","x-module-name":"cloud.costs.v2"},"Instance":{"description":"Instance(id: 'str', name: 'str', total_ecu: 'int', type: 'str', product_line_items: 'list[ProductLineItem]')","properties":{"id":{"type":"string"},"name":{"type":"string"},"product_line_items":{"items":{"$ref":"#/components/schemas/ProductLineItem"},"type":"array"},"total_ecu":{"type":"integer"},"type":{"type":"string"}},"required":["id","name","total_ecu","type","product_line_items"],"type":"object","x-module-name":"cloud.costs.v2"},"Instances":{"description":"Instances(total_ecu: 'int', instances: 'list[Instance]')","properties":{"instances":{"items":{"$ref":"#/components/schemas/Instance"},"type":"array"},"total_ecu":{"type":"integer"}},"required":["total_ecu","instances"],"type":"object","x-module-name":"cloud.costs.v2"},"Items":{"description":"Items(total_ecu: 'int', products: 'list[Product]')","properties":{"products":{"items":{"$ref":"#/components/schemas/Product"},"type":"array"},"total_ecu":{"type":"integer"}},"required":["total_ecu","products"],"type":"object","x-module-name":"cloud.costs.v2"},"Product":{"description":"Product(total_ecu: 'int', type: 'str', product_line_items: 'list[ProductLineItem]')","properties":{"product_line_items":{"items":{"$ref":"#/components/schemas/ProductLineItem"},"type":"array"},"total_ecu":{"type":"integer"},"type":{"type":"string"}},"required":["total_ecu","type","product_line_items"],"type":"object","x-module-name":"cloud.costs.v2"},"ProductLineItem":{"description":"ProductLineItem(name: 'str', total_ecu: 'int', type: 'str', sku: 'str', unit: 'str', quantity: 'Quantity', display_quantity: 'DisplayQuantity', rate: 'Rate', kind: 'str | None', quantities: 'list[ProductLineItemQuantity]')","properties":{"display_quantity":{"$ref":"#/components/schemas/DisplayQuantity"},"kind":{"type":"string"},"name":{"type":"string"},"quantities":{"items":{"$ref":"#/components/schemas/ProductLineItemQuantity"},"type":"array"},"quantity":{"$ref":"#/components/schemas/Quantity"},"rate":{"$ref":"#/components/schemas/Rate"},"sku":{"type":"string"},"total_ecu":{"type":"integer"},"type":{"type":"string"},"unit":{"type":"string"}},"required":["name","total_ecu","type","sku","unit","quantity","display_quantity","rate","quantities"],"type":"object","x-module-name":"cloud.costs.v2"},"ProductLineItemQuantity":{"description":" Represents the cost structure, segmenting the quantities by price range and allocating the usage to tiers if price is tiered. If price is not tiered and if the pricing didn't change during the entire usage range, quantities will be empty (otherwise it would be redundant data). ","properties":{"from":{"format":"date-time","type":"string"},"quantity":{"$ref":"#/components/schemas/Quantity"},"rate":{"$ref":"#/components/schemas/Rate"},"tiers":{"items":{"$ref":"#/components/schemas/ProductLineItemTier"},"type":"array"},"to":{"format":"date-time","type":"string"},"total_ecu":{"type":"integer"}},"required":["from","to","total_ecu","rate","tiers"],"type":"object","x-module-name":"cloud.costs.v2"},"ProductLineItemTier":{"description":"ProductLineItemTier(min: 'int', max: 'int | None', total_ecu: 'int', quantity: 'Quantity', rate: 'Rate')","properties":{"max":{"type":"integer"},"min":{"type":"integer"},"quantity":{"$ref":"#/components/schemas/Quantity"},"rate":{"$ref":"#/components/schemas/Rate"},"total_ecu":{"type":"integer"}},"required":["min","total_ecu","quantity","rate"],"type":"object","x-module-name":"cloud.costs.v2"},"Quantity":{"description":"Quantity","properties":{"formatted_value":{"type":"string"},"value":{"oneOf":[{"type":"integer"},{"type":"number"}]}},"required":["value","formatted_value"],"type":"object","x-module-name":"cloud.costs.v2"},"Rate":{"description":"Rate(value: 'int', formatted_value: 'str')","properties":{"formatted_value":{"type":"string"},"value":{"type":"integer"}},"required":["value","formatted_value"],"type":"object","x-module-name":"cloud.costs.v2"},"UnauthorizedError":{"type":"string"}},"securitySchemes":{"apiKeyAuth":{"description":"Requires 'ApiKey' prefix. E.g. `ApiKey \u003ctoken\u003e`","in":"header","name":"Authorization","type":"apiKey"},"basicAuth":{"scheme":"basic","type":"http"},"bearerAuth":{"bearerFormat":"token","scheme":"bearer","type":"http"},"webhookAuth":{"bearerFormat":"token","scheme":"bearer","type":"http"}}},"x-topics":[{"title":"Authentication","content":"Platform Billing Service API supports key-based authentication.\nYou must [create an API key](https://www.elastic.co/guide/en/cloud/current/ec-api-authentication.html) and use the encoded value in the request header.\nFor convenience, you can export your API key into your shell environment:\n\n```\nexport EC_API_KEY=\"YOUR_GENERATED_API_KEY\"\n```\n\nFor example, the following `curl` command retrieves costs associated with all items:\n\n```\ncurl -H \"Authorization: ApiKey $EC_API_KEY\" \"https://cloud.elastic.co/api/v2/billing/organizations/{organization_id}/costs/items?from=2025-08-01T00:00:00Z\u0026to=2025-08-31T00:00:00Z\"\n```\n"}]}