For the complete documentation index, see llms.txt. This page is also available as Markdown.

Metering

Emit Metering Event

post

Emit one metering event for the calling workspace.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Body
event_typestring · min: 1 · max: 64RequiredPattern: ^[a-z][a-z0-9._]*$
metering_quantitynumberRequired
metering_sourcestring · enumRequired

Traffic class — 'production' or 'simulation'.

Possible values:
effective_atstring · date-time · nullableOptional

When the event happened. Defaults to ingest time.

metering_unitstring · min: 1 · max: 32 · nullableOptional
event_idstring · uuid · nullableOptional

Optional deterministic row id (typically uuid5(NAMESPACE, '')). Re-emitting with the same value lands on the same world_events row instead of double-billing. Use for backfills and retries. Default: server generates a random uuid4.

Responses
202

Successful Response

application/json
statusconst: acceptedRequired

Emission outcome. Always 'accepted' on 202.

event_typestring · min: 1 · max: 64Required

Echo of the emitted event_type.

post/v1/{workspace_id}/metering/emit
POST /v1/{workspace_id}/metering/emit HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 248

{
  "event_type": "text",
  "metering_quantity": 1,
  "metering_source": "production",
  "effective_at": "2026-01-01T00:00:00.000Z",
  "metering_unit": "text",
  "metering_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "event_id": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "status": "text",
  "event_type": "text"
}

Last updated

Was this helpful?