Inference Logoinference.sh

Subscription

Manage team subscriptions and browse self-serve plans.

Subscription endpoints require billing:read (view) or billing:write (create, change, cancel, portal). Plan listing is public.

Billing API — balance top-ups and saved payment methods


List plans

GET /plans

Returns all active plans (Starter, Pro, Team, Enterprise, and any custom plans). No authentication required.

Use the self_serve field to see which plans support Stripe Checkout signup. The default Starter tier is included for limits reference but is not subscribable — teams without a paid subscription receive Starter entitlements automatically.

In the workspace, browse the same plans at Pricing with a comparison table and monthly/yearly toggle. Logged-in users can start Stripe Checkout from that page; existing subscribers are routed to Settings → Subscription.

Provider price IDs are stripped from the public response.

Response

Array of plan objects:

FieldTypeDescription
idstringPlan ID (use in subscription requests)
namestringDisplay name
descriptionstringPlan description
price_monthlyintMonthly price in cents (nullable)
price_yearlyintYearly price in cents (nullable)
credits_monthlyint64Included credits per period (microcents)
limitsobjectPlan limit definitions (maps to entitlement resources)
self_servebooleanWhether users can subscribe via checkout

Example:

bash
1curl https://api.inference.sh/plans \2  -H "X-API-Version: 2"

Get subscription

GET /subscription

Returns the current team's paid subscription, or null when no Stripe subscription is active.

Teams with null still run on the Starter tier: entitlements come from the Starter plan (see GET /entitlements and GET /entitlements/usage). Add credits via Billing or subscribe to Pro or Team for higher limits and included monthly credits.

Requires billing:read.

Response

FieldTypeDescription
plan_idstringSubscribed plan ID
planobjectEmbedded PlanDTO when loaded
intervalstringmonthly or yearly
statusstringtrialing, active, past_due, canceled, or paused
current_period_startstringISO timestamp
current_period_endstringISO timestamp
trial_endstringISO timestamp (optional)
cancel_at_period_endbooleanSubscription ends at period end if true
credits_per_periodint64Credits granted each period (microcents)

Stripe subscription IDs are omitted from public responses.

Example:

bash
1curl https://api.inference.sh/subscription \2  -H "Authorization: Bearer inf_your_key" \3  -H "X-API-Version: 2"

Create subscription

POST /subscription

Creates a Stripe Checkout session for subscription signup. Requires billing:write.

Body:

FieldTypeRequiredDescription
plan_idstringYesPlan ID from GET /plans
intervalstringNomonthly (default) or yearly
success_urlstringNoRedirect after success (defaults to {origin}/settings/billing/subscription?success=1)
cancel_urlstringNoRedirect if canceled (defaults to {origin}/settings/billing/subscription)

Response:

json
1{2  "url": "https://checkout.stripe.com/..."3}

Redirect the user to url to complete signup. After Stripe Checkout, the workspace reads ?success=1 on the subscription settings page, refreshes subscription state, and shows a confirmation toast.


Change plan

PUT /subscription

Upgrade or downgrade the active subscription. Requires billing:write.

Body:

json
1{2  "plan_id": "plan_pro"3}

Returns the updated SubscriptionDTO.


Cancel subscription

DELETE /subscription

Cancel the team's subscription. Requires billing:write.

Body (optional):

json
1{2  "at_period_end": true3}

Defaults to at_period_end: true (cancel at end of billing period). Set false for immediate cancellation.


Resume subscription

POST /subscription/resume

Resume a subscription that was set to cancel at period end. Requires billing:write.


Billing portal

POST /subscription/portal

Creates a Stripe Customer Portal session for managing payment methods and invoices. Requires billing:write.

Body:

FieldTypeRequiredDescription
return_urlstringYesURL to return to after the portal session

Response:

json
1{2  "url": "https://billing.stripe.com/..."3}

Plan limits

Plan limits define caps enforced at runtime — concurrency, request rate, storage, team seats, triggers, data retention, BYOK, and more. When a limit is exceeded, the API returns 402 (limit_exceeded) or 403 (feature_not_available) with structured error metadata.

Each limit in GET /plans responses includes a label field with a human-readable name (for example concurrent tasks, triggers) and an optional unit field for display formatting (for example mb, days for retention_days). Limits with a zero cap or no label are omitted from workspace plan cards.

Use GET /entitlements/usage (requires authentication) to inspect current usage vs limits. Use GET /entitlements to list entitlement rows without usage counts.

In the workspace, entitlement errors open an upgrade modal that lists higher tiers and marks the recommended plan — the cheapest option that resolves the blocked resource. The subscription settings page also shows live resource usage from GET /entitlements/usage with progress bars (warning at 80%, highlighted at the cap). Manage subscriptions at Settings → Billing → Subscription. See REST overview — Workspace modals.

Entitlements API — Get usage


we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.