Skip to main content
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.
organizations
array
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.
name
string
required
Organization name (1-255 characters)
organization
object
The created organization
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.
id
string
required
Organization ID
name
string
Organization name (1-255 characters)
billingEmail
string
Billing email address
billingCompany
string
Company name for invoices
billingAddress
string
Billing address
billingTaxId
string
Tax ID or VAT number
billingNotes
string
Additional billing notes
retentionLevel
'retain' | 'none'
Data retention level:
  • retain: Keep logs for 90 days (Pro/Enterprise)
  • none: Keep logs for 3 days (Free)
autoTopUpEnabled
boolean
Enable automatic credit top-up
autoTopUpThreshold
number
Credit balance threshold for auto top-up (min: $5)
autoTopUpAmount
number
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.
id
string
required
Organization ID
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.
id
string
required
Organization ID
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.
id
string
required
Organization ID
transactions
array
Array of transaction objects ordered by date (newest first)
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.
id
string
required
Organization ID
referredCount
number
Number of organizations referred
curl https://api.llmgateway.io/organization/org_abc123/referral-stats \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
  "referredCount": 3
}

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

  1. Set a credit balance threshold (e.g., $10)
  2. Set a top-up amount (e.g., $50)
  3. When credits fall below threshold, Gateway automatically charges your payment method
  4. 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."
}

Build docs developers (and LLMs) love