Request Logs and Account Pricing
Look up the charge for a single call by request ID or task ID - Page through every consume and error record by time range - Get the price your account actually pays for a model
← すべてのドキュメントUse your API Key to look up the charge for each call, and the actual price your account pays for a model. None of the three endpoints check the balance; they work even when the balance is 0.
curl 'https://api.apisea.ai/v1/logs/requests/task_01M6ZDAXTC8QXYCDM5PXPM413R' \
--header 'Authorization: Bearer <token>'curl --get 'https://api.apisea.ai/v1/logs/requests' \
--header 'Authorization: Bearer <token>' \
--data-urlencode 'start_timestamp=1762732800' \
--data-urlencode 'end_timestamp=1762736400' \
--data-urlencode 'limit=1000'curl --get 'https://api.apisea.ai/v1/pricing/model' \
--header 'Authorization: Bearer <token>' \
--data-urlencode 'model=doubao-seedance-2.0' \
--data-urlencode 'resolution=720P' \
--data-urlencode 'duration=5'{
"object": "list",
"request_id": "task_01M6ZDAXTC8QXYCDM5PXPM413R",
"data": [
{
"id": "task_01M6ZDAXTC8QXYCDM5PXPM413R",
"type": "consume",
"status": "succeeded",
"created_at": 1762740123,
"model_name": "doubao-seedance-2.0",
"token_name": "prod-server",
"task_id": "task_01M6ZDAXTC8QXYCDM5PXPM413R",
"prompt_tokens": 0,
"completion_tokens": 0,
"cache_tokens": 0,
"cache_creation_tokens": 0,
"cost_usd": 0.6,
"cost_credits": 6
}
]
}{
"object": "list",
"data": [
{
"id": "<request ID>",
"type": "consume",
"status": "succeeded",
"created_at": 1762732805,
"model_name": "gpt-5.5",
"token_name": "prod-server",
"prompt_tokens": 1200,
"completion_tokens": 350,
"cache_tokens": 0,
"cache_creation_tokens": 0,
"latency_ms": 2310,
"first_token_ms": 420,
"cost_usd": 0.004125,
"cost_credits": 0.04125
}
],
"has_more": true,
"next_cursor": "AQAAAABpEoXlAjIwMjYxMTEw...",
"watermark": 1762739700
}{
"model": "doubao-seedance-2.0",
"canonical_model": "doubao-seedance-2.0",
"currency": "USD",
"group": "vip",
"billing_type": "per_second",
"unit": "per_second",
"spec": { "resolution": "720P", "duration": 5 },
"spec_source": "request",
"estimated": false,
"unit_price_usd": 0.12,
"quantity": 5,
"total_usd": 0.6,
"credits": { "unit_price": 1.2, "total": 6 },
"price_source": "membership",
"price_factors": ["membership"],
"membership_tier": "gold"
}Authentication
AuthorizationstringrequiredUse the same API Key you use to call models, with Bearer Token authentication. Get your key on the API Key management page.
Authorization: Bearer YOUR_API_KEYEndpoints
GET /v1/logs/requests/{id} Look up a single record by request ID
GET /v1/logs/requests Sync logs by time range
GET /v1/pricing/model Get account pricingAmounts are in USD; cost_credits and credits are in credits, equal to USD × 10.
Look up a single record by request ID
GET /v1/logs/requests/{id}idstringrequired- Synchronous calls: the value of the
X-APISea-Request-Idresponse header - Asynchronous tasks: the task ID returned on submission
Note
Logs are written asynchronously and usually appear within a few seconds after the request ends. If you get
404 log_not_found, retry later. Asynchronous tasks must be looked up by task ID, and only have a record once the task has completed or failed.
The lookup covers the whole account that owns the API Key. data is an array; the same ID may have both a consume record and an error record. Main fields:
| Field | Description |
|---|---|
id | Request ID or task ID |
type | consume or error |
created_at | Record time, Unix seconds; for asynchronous tasks, the settlement time |
model_name | Model name |
token_name | Name of the API Key that made the call (the name when the record was written; names may repeat). To tell keys apart precisely, filter by token_id in the sync endpoint |
prompt_tokens / completion_tokens | Input / output tokens |
cost_usd | Amount charged for this record (USD) |
cost_credits | Credits charged |
cost_usd is the final settled amount: error records are always 0, and refunds for failures are completed before the record is written. Summing records whose type is consume gives the total charged for your calls.
Sync Request Logs
GET /v1/logs/requestsPage through every record in your account over a time range — ideal for scheduled reconciliation. Each record has the same fields as the single-record lookup.
start_timestampintegerrequiredStart time, Unix timestamp in seconds.
end_timestampintegerEnd time, Unix timestamp in seconds. Defaults to now. Both ends are inclusive, and the range must not exceed 31 days.
typestringdefault: allRecord type: all, consume, or error.
modelstringFilter by model name.
token_idintegerOnly return records of the given API Key. Copy the ID from the "API Keys" list in the console (shown below the key name); the ID stays the same after the key is rotated.
limitintegerdefault: 100Page size, 1–1000.
cursorstringPagination cursor. Pass back the previous page's next_cursor unchanged, and keep all other parameters the same while paging.
In the response, has_more tells you whether there is another page, next_cursor is the cursor for the next page, and watermark is the server time minus 300 seconds.
Tip
Recommended sync pattern: keep each run's
end_timestampno later thanwatermark; start the next run 10 minutes before the previous run's end and dedupe by(id, type); within one time window, keep paging untilhas_moreisfalse.
Get account pricing
GET /v1/pricing/modelGet the actual price the account that owns the current API Key pays for a model. Custom pricing, membership pricing, group ratio, and discounts are all applied, matching what you are charged when calling. The pricing page shows public prices; use this endpoint to estimate costs for your own account.
modelstringrequiredModel name; aliases are supported.
resolutionstringResolution or tier; must be a tier the model supports.
sizestringImage size.
qualitystringQuality tier.
durationintegerDuration in seconds, 1–3600, for per-second models.
nintegerNumber of outputs, 1–100.
Without spec parameters, the model's default spec is quoted. For per-second models, only the per-second price is returned when duration is omitted.
Main response fields:
| Field | Description |
|---|---|
unit | Price unit: per_image, per_call, per_second, per_million_tokens |
unit_price_usd | Unit price (USD) |
total_usd | Total price for this spec (USD) |
unit_prices | Returned for token-billed models: price per million tokens, e.g. input, output |
estimated | true means the final charge depends on actual usage (e.g. token billing); the quote is for reference only |
price_source | Price source: membership (membership price), user_override (custom price), group (group price), default (standard price) |
Up to 60 requests per minute per API Key.
Errors
| HTTP status | error.code | Description |
|---|---|---|
| 400 | invalid_request_id / invalid_request, etc. | Invalid parameter; see message for details |
| 400 | time_range_too_large | Log time range exceeds 31 days |
| 401 / 402 / 403 | — | API Key invalid, expired, or disabled |
| 404 | log_not_found | Log record not found; it may not have been written yet |
| 404 | model_not_found / no_valid_pricing | Model does not exist or has no pricing |
| 429 | — | Too many requests |
| 500 / 503 | — | Service temporarily unavailable, please retry later |
ドキュメントに問題が見つかりましたか?support@apisea.aiまでメールでお知らせください。