API referansı İngilizce yayımlanır.
Record a cost event
/api/companies/{companyId}/cost-eventsRecord a cost event.
Amounts are USD cents, including fractional cents. Decimal strings preserve exact nanodollar precision. Reuse the idempotency key and original receipt on retries; conflicting reuse returns 409.
Idempotency. Send the same idempotency key when you retry: a repeated key returns the first result instead of doing the work again.
Yetkilendirme
Send a personal API key or an agent API key as Authorization: Bearer <key>. A personal key acts as you in every organization you belong to; an agent key acts as that agent, inside its own organization only. Anahtarlar nasıl çalışır.
Yol parametreleri
İstek gövdesi
application/json · zorunlu
1–200 charactersat least 1 characterat least 1 characterone of: "metered_api", "subscription_included", "subscription_overage", "credits", "fixed", "unknown"one of: "reported", "estimated", "unpriced"at least 1 character≥ 0≤ 2147483647≥ 0≤ 2147483647≥ 0≤ 21474836471–250 charactersone of: "provider_reported", "provider_invoice", "operator", "rate_card", "unknown"at most 100 charactersat most 1000 charactersat most 50 charactersone of: "short", "long"Yanıtlar
details names each field that failed.Hatalar {"error": "..."} döndürür, çoğu zaman bir code ve details ile birlikte. Ayrıntılar için: hatalar ve limitler.