Skip to content

Edgee Demo Day · November 10

Register
Console API
Console API

Export Cost Data

Export AI Gateway usage and cost data

GET/v1/organizations/{orgId}/logs/export
GEThttps://api.edgee.app/v1/organizations/{orgId}/logs/export

Try this endpoint

Configure your request, then run the curl command in your terminal.

Time range, for example 24h, 7d or 30d.

csv or json.

Start date in ISO 8601 format. Overrides period.

End date in ISO 8601 format.

Run in your terminal

Set EDGEE_CONSOLE_API_TOKEN to your personal Console API token in your terminal, then copy and run this command. Requests run against your live organization.

Fill in orgId above before running.

curl
curl --include --no-buffer --globoff --request GET 'https://api.edgee.app/v1/organizations/{orgId}/logs/export' \
  --header "Authorization: Bearer $EDGEE_CONSOLE_API_TOKEN"

Export your organization's AI Gateway usage and cost data for analysis, reporting, or billing purposes. You can export data in CSV or JSON format with flexible filtering options.

Query Parameters

periodstringDefault: 24h

Time range for the export. Examples: 1h, 24h, 7d, 30d

from_datestring

Start date in ISO 8601 format (e.g., 2026-04-01). Overrides the period parameter if provided.

to_datestring

End date in ISO 8601 format (e.g., 2026-04-08). Overrides the period parameter if provided.

formatstringDefault: csv

Export format. Options: csv or json

api_key_id[]string

Filter by specific API key IDs. This parameter can be repeated multiple times to include multiple keys.

tags[]string

Filter by tags. This parameter can be repeated multiple times to include multiple tags.

Examples

Request examples

Using Period
curl "https://api.edgee.app/v1/organizations/{orgId}/logs/export?period=7d&format=csv" \
  -H "Authorization: Bearer <your_api_token>"
Using Date Range
curl "https://api.edgee.app/v1/organizations/{orgId}/logs/export?from_date=2026-04-01&to_date=2026-04-08&format=json" \
  -H "Authorization: Bearer <your_api_token>"
With Filters
curl "https://api.edgee.app/v1/organizations/{orgId}/logs/export?period=30d&format=csv&api_key_id[]=key1&api_key_id[]=key2&tags[]=production" \
  -H "Authorization: Bearer <your_api_token>"

Response

The response is a CSV or JSON file containing your usage and cost data, ready for download or further processing.

CSV format includes columns for:

  • Timestamp
  • API Key
  • Model
  • Provider
  • Input Tokens
  • Output Tokens
  • Cost
  • Tags

JSON format includes an array of usage records with the same information as CSV.