Organizations are the top-level entity in LLM Gateway. Each organization can have multiple projects, team members, and billing settings.
List Organizations
Retrieve all organizations you belong to.
Array of organization objects you have access to
curl https://api.llmgateway.io/organization \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"organizations": [
{
"id": "org_abc123",
"name": "Acme Corp",
"billingEmail": "[email protected]",
"billingCompany": "Acme Corporation",
"billingAddress": "123 Main St, San Francisco, CA 94105",
"billingTaxId": "US123456789",
"billingNotes": null,
"credits": "50.00",
"plan": "pro",
"planExpiresAt": "2024-12-31T23:59:59Z",
"retentionLevel": "retain",
"status": "active",
"autoTopUpEnabled": true,
"autoTopUpThreshold": "10.00",
"autoTopUpAmount": "50.00",
"referralEarnings": "5.00",
"isPersonal": false,
"devPlan": "none",
"devPlanCreditsUsed": "0",
"devPlanCreditsLimit": "0",
"devPlanBillingCycleStart": null,
"devPlanExpiresAt": null,
"devPlanAllowAllModels": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
]
}
Create Organization
Create a new organization. You’ll be set as the owner.
Organization name (1-255 characters)
curl -X POST https://api.llmgateway.io/organization \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My New Org"}'
{
"organization": {
"id": "org_new123",
"name": "My New Org",
"billingEmail": "[email protected]",
"billingCompany": null,
"billingAddress": null,
"billingTaxId": null,
"billingNotes": null,
"credits": "0",
"plan": "free",
"planExpiresAt": null,
"retentionLevel": "none",
"status": "active",
"autoTopUpEnabled": false,
"autoTopUpThreshold": "10",
"autoTopUpAmount": "10",
"referralEarnings": "0",
"isPersonal": false,
"devPlan": "none",
"devPlanCreditsUsed": "0",
"devPlanCreditsLimit": "0",
"devPlanBillingCycleStart": null,
"devPlanExpiresAt": null,
"devPlanAllowAllModels": false,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}
A default project named “Default Project” is automatically created when you create an organization.
Update Organization
Update organization settings. All fields are optional.
Organization name (1-255 characters)
Company name for invoices
Data retention level:
retain: Keep logs for 90 days (Pro/Enterprise)
none: Keep logs for 3 days (Free)
Enable automatic credit top-up
Credit balance threshold for auto top-up (min: $5)
Amount to add when auto top-up triggers (min: $10)
Only organization owners can update billing and policy settings.
curl -X PATCH https://api.llmgateway.io/organization/org_abc123 \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp Updated",
"billingEmail": "[email protected]",
"billingCompany": "Acme Corporation",
"billingAddress": "456 New St, SF, CA 94105",
"billingTaxId": "US987654321",
"autoTopUpEnabled": true,
"autoTopUpThreshold": 20,
"autoTopUpAmount": 100
}'
{
"message": "Organization updated successfully",
"organization": {
"id": "org_abc123",
"name": "Acme Corp Updated",
"billingEmail": "[email protected]",
"billingCompany": "Acme Corporation",
"billingAddress": "456 New St, SF, CA 94105",
"billingTaxId": "US987654321",
"billingNotes": null,
"credits": "50.00",
"plan": "pro",
"planExpiresAt": "2024-12-31T23:59:59Z",
"retentionLevel": "retain",
"status": "active",
"autoTopUpEnabled": true,
"autoTopUpThreshold": "20",
"autoTopUpAmount": "100",
"referralEarnings": "5.00",
"isPersonal": false,
"devPlan": "none",
"devPlanCreditsUsed": "0",
"devPlanCreditsLimit": "0",
"devPlanBillingCycleStart": null,
"devPlanExpiresAt": null,
"devPlanAllowAllModels": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-16T14:20:00Z"
}
}
Delete Organization
Soft-delete an organization. The organization will be marked as deleted.
Deleting an organization will also delete all projects, API keys, and associated data. This action cannot be undone.
curl -X DELETE https://api.llmgateway.io/organization/org_abc123 \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"message": "Organization deleted successfully"
}
List Projects
Retrieve all projects for an organization.
curl https://api.llmgateway.io/organization/org_abc123/projects \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"projects": [
{
"id": "proj_xyz789",
"name": "Production",
"organizationId": "org_abc123",
"cachingEnabled": true,
"cacheDurationSeconds": 300,
"mode": "hybrid",
"status": "active",
"createdAt": "2024-01-10T10:30:00Z",
"updatedAt": "2024-01-10T10:30:00Z"
},
{
"id": "proj_abc456",
"name": "Development",
"organizationId": "org_abc123",
"cachingEnabled": false,
"cacheDurationSeconds": 60,
"mode": "credits",
"status": "active",
"createdAt": "2024-01-05T09:15:00Z",
"updatedAt": "2024-01-05T09:15:00Z"
}
]
}
List Transactions
Retrieve billing transactions for an organization.
Array of transaction objects ordered by date (newest first)
Transaction type: subscription_start, subscription_cancel, subscription_end, credit_topup, credit_refund, credit_gift, dev_plan_start, dev_plan_upgrade, dev_plan_downgrade, dev_plan_cancel, dev_plan_end, dev_plan_renewal
Credit amount added/removed
Currency code (e.g., “USD”)
status
'pending' | 'completed' | 'failed'
Transaction status
curl https://api.llmgateway.io/organization/org_abc123/transactions \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"transactions": [
{
"id": "txn_123",
"organizationId": "org_abc123",
"type": "credit_topup",
"amount": "50.00",
"creditAmount": "50.00",
"currency": "USD",
"status": "completed",
"stripePaymentIntentId": "pi_abc123",
"stripeInvoiceId": null,
"description": "Credit top-up",
"relatedTransactionId": null,
"refundReason": null,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:05Z"
},
{
"id": "txn_456",
"organizationId": "org_abc123",
"type": "subscription_start",
"amount": "49.00",
"creditAmount": null,
"currency": "USD",
"status": "completed",
"stripePaymentIntentId": null,
"stripeInvoiceId": "in_def456",
"description": "Pro plan subscription",
"relatedTransactionId": null,
"refundReason": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:05Z"
}
]
}
Get Referral Stats
Retrieve referral statistics for an organization.
Number of organizations referred
curl https://api.llmgateway.io/organization/org_abc123/referral-stats \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
Plans
LLM Gateway offers three organization plans:
Free Plan
- 3-day log retention
- 5 API keys per project
- 10 projects max
- Community support
Pro Plan ($49/month)
- 90-day log retention
- 20 API keys per project
- 10 projects max
- Provider key management
- Priority support
Enterprise Plan
- Custom log retention
- Unlimited API keys
- Unlimited projects
- Guardrails & security features
- Audit logs
- Dedicated support
- Custom contracts
Contact [email protected] for Enterprise pricing.
Auto Top-Up
Automatic credit top-up ensures your services never stop due to insufficient credits.
How It Works
- Set a credit balance threshold (e.g., $10)
- Set a top-up amount (e.g., $50)
- When credits fall below threshold, Gateway automatically charges your payment method
- Credits are added immediately
Configuration
curl -X PATCH https://api.llmgateway.io/organization/org_abc123 \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"autoTopUpEnabled": true,
"autoTopUpThreshold": 10,
"autoTopUpAmount": 50
}'
Auto top-up requires a valid payment method on file. Charges may take a few minutes to process.
Error Responses
{
"message": "You have reached the limit of 3 organizations. Please reach out to support to increase this limit."
}