# Invoice object Represents an invoice for organization usage on the Freddy AI platform. ## Object Structure **`id`** string Unique identifier for the invoice (format: `inv_`). **`invoice_number`** string Human-readable invoice number (format: `INV-{YYYY}-{MM}-{ORG_PREFIX}-{SEQUENCE}`). **`organization_id`** string Organization ID this invoice belongs to (format: `org_`). **`organization_name`** string Name of the organization. **`billing_period_start`** datetime Start of the billing period (ISO 8601 format). **`billing_period_end`** datetime End of the billing period (ISO 8601 format). **`issue_date`** datetime Date the invoice was issued (ISO 8601 format). **`due_date`** datetime Payment due date (ISO 8601 format). **`payment_date`** datetime | null Date payment was received, or null if unpaid (ISO 8601 format). **`currency`** string Currency code (CHF, USD, EUR, GBP). **`exchange_rate`** number Exchange rate used for currency conversion. **`subtotal`** number Subtotal amount before tax. **`tax_rate`** number Tax rate applied (e.g., 0.081 for 8.1% Swiss VAT). **`tax_amount`** number Tax amount calculated. **`total_amount`** number Total amount including tax. **`status`** string Invoice status. Possible values: `draft`, `issued`, `paid`, `overdue`, `cancelled`. **`items`** array Array of invoice line items (see Invoice Item object below). **`created_at`** datetime Timestamp when the invoice was created (ISO 8601 format). **`updated_at`** datetime Timestamp when the invoice was last updated (ISO 8601 format). ## Invoice Item Object **`id`** string Unique identifier for the line item (format: `invitem_`). **`description`** string Description of the line item (e.g., "GPT-4 Turbo - Input Tokens"). **`model_name`** string Name of the AI model used. **`provider`** string Model provider (e.g., "openai", "anthropic"). **`quantity`** number Quantity of units consumed. **`unit`** string Unit of measurement (e.g., "1K tokens"). **`unit_price`** number Price per unit. **`amount`** number Total amount for this line item (quantity × unit_price). **`input_tokens`** integer | null Number of input tokens (for input token line items). **`output_tokens`** integer | null Number of output tokens (for output token line items). **`total_requests`** integer Total number of API requests for this model. ## Example ```json { "id": "inv_123e4567e89b12d3a456426614174000", "invoice_number": "INV-2024-12-AIT-001", "organization_id": "org_123e4567e89b12d3a456426614174000", "organization_name": "Aitronos AG", "billing_period_start": "2024-12-01T00:00:00Z", "billing_period_end": "2025-01-01T00:00:00Z", "issue_date": "2024-12-31T23:59:59Z", "due_date": "2025-01-30T23:59:59Z", "payment_date": null, "currency": "CHF", "exchange_rate": 1.0, "subtotal": 1250.50, "tax_rate": 0.081, "tax_amount": 101.29, "total_amount": 1351.79, "status": "issued", "items": [ { "id": "invitem_123e4567e89b12d3a456426614174000", "description": "GPT-4 Turbo - Input Tokens", "model_name": "gpt-4-turbo", "provider": "openai", "quantity": 1250.5, "unit": "1K tokens", "unit_price": 0.01, "amount": 12.51, "input_tokens": 1250500, "output_tokens": null, "total_requests": 1523 }, { "id": "invitem_456e4567e89b12d3a456426614174000", "description": "GPT-4 Turbo - Output Tokens", "model_name": "gpt-4-turbo", "provider": "openai", "quantity": 3420.75, "unit": "1K tokens", "unit_price": 0.03, "amount": 102.62, "input_tokens": null, "output_tokens": 3420750, "total_requests": 1523 } ], "created_at": "2024-12-31T23:59:59Z", "updated_at": "2024-12-31T23:59:59Z" } ```