# How much does it cost to add GPT to a SaaS app?

> Adding GPT to a SaaS app costs $0.10 to $0.50 per million tokens for standard chat, with prepaid credits and safety caps starting at $5 per day.

**Adding GPT to a SaaS app costs as little as $0.10 per million input tokens and $0.50 per million output tokens for standard chat, up to $1.00 and $5.00 per million tokens for complex reasoning models.** Because you pay strictly for what your users consume, a small software product with hundreds of daily AI interactions often costs just a few dollars a month. On thelastapi, you can start testing immediately with $2 of trial credit, without committing to fixed monthly minimums or complex enterprise contracts.

Estimating your production spend requires looking at token volume, model choices, auxiliary tasks like embeddings, and safety caps that keep rogue loops or high-traffic spikes from draining your balance.

## What does GPT actually cost per token and per feature?

Language models do not charge by the query or by server uptime. They charge by the token, where 1,000 tokens equal roughly 750 English words. Every interaction has an input cost (the system prompt, past conversation history, and user input) and an output cost (the tokens generated by the model).

For most SaaS products, features fall into four categories:

1. **Everyday customer chat, writing assistance, and JSON extraction**: The standard tier model, `vibiz/fast`, runs on GPT-6 Luna. It costs $0.10 per million input tokens and $0.50 per million output tokens. A typical user prompt of 500 tokens with a 250-token response costs roughly $0.000175. You can execute thousands of these interactions before spending a single dollar.
2. **Complex logic, planning, and code evaluation**: When your software needs to think before answering, `vibiz/reasoning` runs on GPT-6.1 Terra. It costs $1.00 per million input tokens and $5.00 per million output tokens.
3. **Semantic search and vector retrieval**: If your SaaS searches across user documents or a knowledge base, you convert text into vectors using `vibiz/embed` (text-embedding-3-small) for $0.02 per million tokens, or `vibiz/embed-large` (text-embedding-3-large) for $0.13 per million tokens.
4. **Image generation with legible text**: If your application creates marketing graphics or diagrams containing copy, `vibiz/image-text` runs on GPT-5.4 Image 2 at about $0.04 per generated image.

Every billable unit is recorded with its underlying cost and billed to your prepaid credits with a 10% AI platform margin. For chat requests with very long prompts, note that GPT-6 models apply higher long-context pricing once input tokens pass 272,000 in a single call.

## Cost breakdown by model type

The table below summarizes the exact list prices for OpenAI-backed models available through the gateway on the [AI docs page](https://thelastapi.dev/docs/ai):

| thelastapi model | Underlying lab model | Best suited for | Price (USD) |
| --- | --- | --- | --- |
| `vibiz/fast` | GPT-6 Luna (OpenAI) | Standard chat, tool calls, JSON mode | $0.10 / $0.50 per million tokens |
| `vibiz/reasoning` | GPT-6.1 Terra (OpenAI) | Math, multi-step logic, code planning | $1.00 / $5.00 per million tokens |
| `vibiz/embed` | text-embedding-3-small (OpenAI) | Search, RAG, 1536 dimensions | $0.02 per million tokens |
| `vibiz/embed-large` | text-embedding-3-large (OpenAI) | High-accuracy retrieval, 3072 dimensions | $0.13 per million tokens |
| `vibiz/image-text` | GPT-5.4 Image 2 (OpenAI) | Visual generation with rendered text | about $0.04 per image |

If your application demands alternatives from other labs, such as Claude or Gemini, you can route between them using the same SDK configuration. See [how to access multiple AI models with a single API](https://thelastapi.dev/blog/access-multiple-ai-models-single-api) and [one API key for GPT, Claude and Gemini: how a unified AI API works](https://thelastapi.dev/blog/one-api-key-gpt-claude-gemini) for a broader architectural comparison.

## How do daily spend limits and project budgets protect your margins?

An unmetered AI endpoint hooked to a public SaaS application creates financial exposure. If a background worker enters an infinite loop, or a malicious user scripts queries against your endpoint, your card could face runaway charges.

thelastapi manages this through prepaid credits and multi-tiered guardrails described in [billing and credits](https://thelastapi.dev/docs/billing):

- **Prepaid balance**: Your account draws down against purchased credits. You can add credits in increments of $10, $25, $50, $100, or any custom amount from $5 to $1,000 using card payments. If you want hands-off reliability, turn on auto-recharge to top up an amount between $10 and $1,000 whenever your balance dips below a threshold (minimum $5).
- **Daily safety cap**: Every account comes with an automatic daily spend ceiling of $5 per UTC day across AI and actions. An owner can adjust this in the console or via `PATCH /v1/billing` up to $1,000.
- **Project AI budgets**: Each project has its own daily AI budget, set to $1 per UTC day by default. You can change this using `PATCH /v1/projects/:id/ai` or the CLI:
  ```bash
  vibiz ai budget 25 --project prj_123
  ```
- **Automated threshold alerts**: When usage hits 80% and 100% of a daily cap, account owners receive an alert email and see a banner in the console. Requests exceeding the cap receive an HTTP `429` error with `details.reason: "daily_spend"` or `"project_budget"`.

To understand how alerts and resets work at midnight UTC, read through [usage and limits](https://thelastapi.dev/docs/usage).

## How to track GPT spending per customer in code

To keep your SaaS profitable, you must know which end users generate your AI costs. If you charge a flat subscription fee of $20 a month, a user who consumes $25 in GPT tokens turns your unit economics negative.

You can attribute calls directly to a specific user by passing a pseudonymous customer identifier:

```ts
import OpenAI from 'openai';
import { vibiz } from '@vibiz/app';

// The OpenAI SDK works directly against the gateway
const openai = new OpenAI({
  baseURL: process.env.VIBIZ_AI_BASE_URL,
  apiKey: process.env.VIBIZ_AI_API_KEY,
});

export async function generateSummary(userId: string, prompt: string) {
  const response = await openai.chat.completions.create({
    model: 'vibiz/fast',
    messages: [
      { role: 'system', content: 'Summarize the input text concisely.' },
      { role: 'user', content: prompt }
    ],
    user: userId, // Breaks down spend per end user
  });

  return response.choices[0]?.message.content;
}
```

Passing the `user` field accomplishes two things:
1. It attributes the tokens and cost to that customer in your dashboard and via `vibiz usage --by end_user`.
2. It allows you to enforce an `end_user_daily_budget_usd` configured on the project, cutting off an individual customer once their daily limit is reached without affecting other users.

Every raw JSON response from the gateway includes `cost_micro_usd`, the exact cost of that call in micro-dollars, and `served_model`. You can store this value directly in your database next to the user's action log.

## How to integrate GPT into your SaaS stack

Getting started does not require setting up multiple billing relationships. You can provision your AI environment directly from the CLI:

```bash
vibiz init "Acme Analytics" --resources ai
vibiz dev
```

The `vibiz dev` command writes `.env.development.local`, populating `VIBIZ_AI_BASE_URL` and `VIBIZ_AI_API_KEY`, along with `OPENAI_BASE_URL` and `OPENAI_API_KEY`. If your server imports [@vibiz/app](https://thelastapi.dev/docs/app-sdk), you can access the configuration directly without managing individual strings:

```ts
import OpenAI from 'openai';
import { vibiz } from '@vibiz/app';

const openai = new OpenAI(vibiz.ai);

const res = await openai.chat.completions.create({
  model: 'vibiz/fast',
  messages: [{ role: 'user', content: 'Draft a three-line onboarding tip.' }],
});

console.log(res.choices[0]?.message.content);
```

You can test calls directly from the command line while watching your token costs:

```bash
vibiz ai "Draft a three-line onboarding tip." --model vibiz/fast
vibiz usage --period 24h --by model
```

## Scaling spend and choosing alternative models

As your SaaS grows, you might find that certain tasks run more affordably on other providers. For example, high-volume classification might work well on `vibiz/lite` (DeepSeek V4.1 Flash at $0.14 / $0.42 per million tokens), while complex editing might run on `vibiz/smart` (Claude Sonnet 5.5 at $2.00 / $10.00 per million tokens).

Because the gateway is OpenAI-compatible and catalogues over 400 models from OpenAI, Anthropic, Google, and others, swapping models requires changing only the `model` parameter string. You can switch models dynamically without restructuring client libraries or rewriting prompts. For strategies on keeping your architecture portable, read [add AI features to your SaaS without vendor lock-in](https://thelastapi.dev/blog/ai-features-without-vendor-lock-in).

To begin building without financial surprises, check your environment keys in [keys and environments](https://thelastapi.dev/docs/keys), verify your daily budgets, and let your app scale on your own terms.

## Frequently asked questions

### How much trial credit do I get to test GPT models?

Every new account on thelastapi includes $2.00 of trial credit, which covers hundreds of test completions on standard models like `vibiz/fast`.

### What happens if my SaaS app exceeds its daily AI budget?

When a project hits its daily budget limit, subsequent requests return an HTTP 429 status code with `details.reason: "project_budget"`. Existing deployments, databases, and authentication endpoints continue running normally.

### How can I prevent a single user from running up an expensive AI bill?

You can pass your customer's pseudonymous ID via the `user` field or `X-Vibiz-User` header and set an `end_user_daily_budget_usd` on your project. Once that customer reaches their cap, only their calls are refused.

---

Published 2026-11-15 · https://thelastapi.dev/blog/cost-to-add-gpt-to-saas
