Track usage event
Track a usage event for a metered feature. Deducts from balance/credits if applicable.
Track a usage event for a metered feature. Deducts from balance/credits if applicable.
Authorization
ApiKeyAuth In: header
Header Parameters
Unique key used to safely retry this write for 24 hours without applying it twice.
1 <= length <= 200Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
^[a-z0-9_]+$1 <= length <= 501 <= length <= 2001 <= length <= 200date-time[]0 <= value10 <= value <= 90071992547409910 <= value <= 90071992547409911 <= length <= 2000 <= value <= 90071992547409910 <= value <= 9007199254740991Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/usage/events" \ -H "Content-Type: application/json" \ -d '{ "featureCode": "string", "customerId": "string", "model": "string", "inputTokens": 0, "outputTokens": 0 }'{ "id": "string", "featureCode": "string", "value": 0, "customerId": "string", "eventId": "string", "ts": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "properties": [ { "property": "string", "value": "string" } ], "consumption": { "model": "string", "deducted": 0, "remaining": 0, "blocked": true }, "object": "usage_event", "livemode": true}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}