Skip to main content

Attribute API

Attribute API enables one to interact with the data programmatically, extract large amounts of data and integrate it with your internal systems.

The following document will describe the authentication and endpoints available, response codes, and will provide some code examples for easy use of the Attribute API.

Authentication and Authorization

The authentication with the Attribute API is based on JWT (JSON Web Token).

Note

For security reasons, once generated, the token cannot be recovered. Make sure you keep your token in a secure manner.

To generate your token, please access the Attribute Dashboard. Navigate to the setup/api-tokens page, where you will be able to create new tokens and manage your existing tokens.

API Tokens page in the Attribute Dashboard

Click Create Token to open the new-token dialog. Provide a token name, description, expiration in days, and any IP restrictions, then click Create.

New API Token creation dialog

API Endpoints

Note

AWS usually takes up to 48 hours to update the data, thus the earliest stable daily data is two days ago.

Granularity and Date Parameters

Most endpoints below accept two path parameters that follow the same conventions:

  • granularity: daily to get data for a single day, or monthly to get data for the whole month.
  • date: The date for which to fetch the data, in the format YYYY-MM-DD.
    • When granularity is daily, the data corresponds to that specific day. Entering the current day fetches the data available so far; future dates return an empty response.
    • When granularity is monthly, the day part of the date is ignored and the data covers the entire month. Entering the current month fetches the previous month's data; future months return an empty response. Example: if the date is 2026-05-06 and granularity is monthly, the response will include data for April 2026.

Healthcheck Information

Checks the health of the server.

  • Endpoint: /api/v1/health
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/health
  • Returns: HTTP 200 if the server is healthy.

Resources Information

The Resources Information endpoint returns billing data for individual cloud resources (the billing page in Attribute's dashboard).

  • Endpoint: /api/v1/resources/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/resources/daily/2025-11-10
  • Description: Starts a job to fetch resources data.
  • Parameters:
  • Query Strings:
    • includetags (boolean, optional): If true, includes resource tags in the response. Default false.
  • Returns: JobDescription
Note

Dashboard configurations show $0 cost and show tax are both treated as true in the API.

Workloads Information

The Workloads Information endpoint returns billing data aggregated by workload.

  • Endpoint: /api/v1/workloads/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/workloads/daily/2025-11-10
  • Description: Starts a job to fetch workloads data.
  • Parameters:
  • Query Strings:
    • includelabels (boolean, optional): If true, includes resource labels in the response. Default false.
  • Returns: JobDescription

All Customers Information

The All Customers Information endpoint extracts customer insights from the Attribute platform across all cloud providers, such as the customer cost and amortized, effective, and GCP costs for the resources attributed to each customer. (For the detailed structure of the customer data, see AllCustomerEntryObject.)

  • Endpoint: /api/v1/allcustomers/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/allcustomers/daily/2026-05-01
  • Description: Starts a job to fetch customer data across all cloud providers.
  • Parameters:
  • Returns: JobDescription
  • Result object: AllCustomerEntryObject

Identifiers Information

The Identifiers Information endpoint returns compute cost broken down by identifier — a unit such as a customer, project, or country running on a shared cluster. This lets you see how a single cluster's cost splits across business units based on each identifier's share of requests.

Availability: AWS data only, and only for customers who have multiple units configured through sensor identifiers. For other customers, cost is reported through the standard customer cost flow (see All Customers Information).

  • Endpoint: /api/v1/identifiers/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/identifiers/daily/2026-06-02
  • Description: Starts a job to fetch identifiers cost data.
  • Parameters:
    • granularity: daily to get data for a single day (this endpoint supports daily granularity only)
    • date: See date parameters.
  • Returns: JobDescription

Cost Calculation Types

Each workload + identifier combination is returned four times, once per cost_calculation_type. The type encodes two independent dimensions:

  • Anonymous costs — whether the cost share of requests with no identifier is kept as-is, or redistributed across the identified groups.
  • Unallocated costs — whether billing costs that could not be attributed to any workload are excluded or distributed across workloads.
cost_calculation_typeAnonymous costsUnallocated costs
with_anonymous_without_unallocatedKeptExcluded
with_anonymous_with_unallocatedKeptDistributed
without_anonymous_without_unallocatedRedistributed to identified groupsExcluded
without_anonymous_with_unallocatedRedistributed to identified groupsDistributed

AI Cost Information

The AI Cost Information endpoint retrieves AI cost from all clouds and direct providers — Bedrock, Vertex AI, OpenAI, Azure OpenAI, and Anthropic.

  • Endpoint: /api/v1/aicost/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/aicost/monthly/2025-11-01
  • Description: Starts a job to fetch AI cost data.
  • Parameters:
  • Returns: JobDescription
  • Result object:
{
"results": [
{
"granularity": "MONTHLY",
"data_date": "2026-03-01",
"cloud_provider": "OpenAI",
"resource_type": "OpenAI",
"resource_name": "attribute-cyopcu/gpt-5.2-2025-12-11",
"token_type": "Output Tokens",
"amortized_cost": 0.088521999999999976,
"unblended_cost": 0.088521999999999976
}
]
}

OpenAI Information

The OpenAI Information endpoint retrieves OpenAI-related insights per Customer and Workload from the Attribute platform.

Results are returned only if you have a native OpenAI integration in AWS configured, including a customer identifier.

  • Endpoint: /api/v1/reports/openai/{granularity}/{date}
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/reports/openai/monthly/2025-11-01
  • Description: Starts a job to fetch OpenAI data.
  • Parameters:
  • Returns: JobDescription
  • Result object:

Example OpenAI result object

Job Management

Every data endpoint above returns a JobDescription with an id. Use the endpoints below to track and retrieve the job's results.

Job Status

  • Endpoint: /api/v1/job/{jobid}/status
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/job/{jobid}/status
  • Description: Retrieves the JobDescription for a specific job with its status.
  • Parameters:
    • jobid: The ID of the job.
  • Returns: JobDescription

Fetch

  • Endpoint: /api/v1/job/{jobid}/fetch
  • Method: GET
  • Example: https://api.app.attrb.io/api/v1/job/{jobid}/fetch
  • Description: Fetches the results of a completed job.
  • Parameters:
    • jobid: The ID of the job.
  • Query Strings:
    • maxResults (int, optional): Maximum number of objects inside JobData.results to fetch.
    • token (int, optional): Token for pagination.
  • Returns: JobData

Status Codes

Attribute API uses standard HTTP status codes:

CodeMeaningDescription
400Bad RequestFailed to parse request parameters
401UnauthorizedRequest is not authorized
404Not FoundJob is not completed or no data was found
429Rate LimitToo many requests were made for a single org
500Internal Server ErrorServer errors

Data Structures

JobDescription

FieldDescription
idJob ID
statusJob status: pending, running, completed, failed
reasonFailure reason (applicable for failed status, optional)
lastUpdateUnix timestamp of last status update

JobData

FieldDescription
resultsList of result objects
nextTokenOptional integer for pagination — absent on the final page of results

AllCustomerEntryObject

FieldDescription
customer_nameCustomer identifier
organization_idAttribute organization identifier
granularityGranularity of the data: DAILY or MONTHLY
data_dateThe date of the data
execution_dateThe date the job was executed
dataAttribution data list
data[].resourceResource identifier object
data[].resource.cloud_providerCloud provider type (e.g. AWS, Azure, GCP)
data[].resource.account_idAttribute account ID
data[].resource.customer_rule_identifierAttribution rule identifier
data[].resource.resource_nameResource name (e.g. EKS cluster name)
data[].resource.resource_typeType of resource (e.g. EC2-EKS)
data[].resource.resource_regionRegion of the resource (e.g. us-east-1)
data[].costAttributed cost object
data[].cost.amortized_costAmortized cost value (AWS, MongoDB® Atlas, OpenAI)
data[].cost.effective_costEffective cost value (Azure)
data[].cost.gcp_costCost value (GCP)

Code Examples

Request to the customers API for the daily data on 2026-05-01:

curl -X GET "https://api.app.attrb.io/api/v1/allcustomers/daily/2026-05-01" \
-H "Accept: application/json" \
-H "Authorization: Bearer <JWT Token>"

Response with the JobDescription for the created job:

{
"id": "7a116c30-e245-43cb-b451-f099e84ffdeb",
"status": "pending",
"lastUpdate": 1741012038
}

Request for the status of Job ID 7a116c30-e245-43cb-b451-f099e84ffdeb:

curl -X GET "https://api.app.attrb.io/api/v1/job/7a116c30-e245-43cb-b451-f099e84ffdeb/status" \
-H "Accept: application/json" \
-H "Authorization: Bearer <JWT Token>"

Response indicating that the job has been completed successfully:

{
"id": "7a116c30-e245-43cb-b451-f099e84ffdeb",
"status": "completed",
"lastUpdate": 1741012038
}

Request for 1 row of data:

curl -sG "https://api.app.attrb.io/api/v1/job/7a116c30-e245-43cb-b451-f099e84ffdeb/fetch" \
--data-urlencode "maxResults=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer <JWT Token>"

Response with a single row of data:

{
"results": [
{
"customer_name": "acme_corp",
"organization_id": "org-id",
"granularity": "DAILY",
"data_date": "2026-05-01",
"execution_date": "2026-06-03",
"data": [
{
"resource": {
"cloud_provider": "AWS",
"account_id": "acct-id",
"customer_rule_identifier": "Proportions",
"resource_name": "prod-cluster",
"resource_type": "EC2-EKS",
"resource_region": "us-east-1"
},
"cost": {
"amortized_cost": 12.45,
"effective_cost": 0,
"gcp_cost": 0
}
},
{
"resource": {
"cloud_provider": "Azure",
"account_id": "azure-acct-id",
"customer_rule_identifier": "Proportions",
"resource_name": "vm-prod",
"resource_type": "VirtualMachine",
"resource_region": "eastus"
},
"cost": {
"amortized_cost": 0,
"effective_cost": 8.30,
"gcp_cost": 0
}
},
{
"resource": {
"cloud_provider": "GCP",
"account_id": "gcp-acct-id",
"customer_rule_identifier": "Proportions",
"resource_name": "gke-prod",
"resource_type": "GKE",
"resource_region": "us-central1"
},
"cost": {
"amortized_cost": 0,
"effective_cost": 0,
"gcp_cost": 5.72
}
}
]
}
],
"nextToken": 363
}

Trademarks: AWS is a trademark of Amazon.com, Inc. or its affiliates. Microsoft and Microsoft Azure are trademarks of the Microsoft group of companies. Google Cloud is a trademark of Google LLC. MongoDB is a registered trademark of MongoDB, Inc. OpenAI is a trademark of OpenAI. Anthropic and Claude are trademarks of Anthropic, PBC. All other trademarks are the property of their respective owners.