thelastapi
Get started free

The cheapest LLM API for a student or school project

For a student project, the cheapest LLMs are vibiz/fast and vibiz/smart-mini at $0.10 per million input tokens, with built-in daily spending caps.

On this page 7 sections

The cheapest LLM APIs for a school project are vibiz/fast (running on GPT-6 Luna) and vibiz/smart-mini (running on Claude Haiku 5.5), which both cost $0.10 per million input tokens and $0.50 per million output tokens. New accounts include $2 of trial credit, which is enough to process several million tokens before paying anything. Because school budgets are tight, the platform also enforces a default $1 daily project budget and a $5 daily account ceiling to stop accidental runaway loops.

When you build a class assignment, hackathon demo, or research prototype, you want two things: low token costs and strict spending limits so a bug does not drain your bank account. Here is how to pick the cheapest model, set guardrails, and run your project with standard tools.

Which LLM models cost the least?

Language model costs depend on prompt tokens (input) and generated tokens (output). If your school project processes large datasets, input price dominates. If your project generates essays, code, or extended summaries, output price dominates.

Here is how the entry-level models compare on the platform's price book:

thelastapi modelUnderlying lab modelBest suited forInput price per 1M tokensOutput price per 1M tokens
vibiz/fastGPT-6 Luna (OpenAI)Structured JSON, quick chat, tools$0.10$0.50
vibiz/smart-miniClaude Haiku 5.5 (Anthropic)Fast coding help, essay editing$0.10$0.50
vibiz/liteDeepSeek V4.1 Flash (DeepSeek)Long prompts, research analysis (1M context)$0.14$0.42
vibiz/embedtext-embedding-3-small (OpenAI)Semantic search, vector embeddings$0.02N/A
vibiz/balancedGemini 3.8 Flash (Google)Multimodal tasks, large context$0.825$4.125

For typical student assignments—such as building a study assistant, extracting entities from text, or prototyping a mock startup—vibiz/fast and vibiz/smart-mini offer the lowest entry price at $0.10 per million input tokens. If your assignment involves analyzing long research documents up to 1 million tokens, vibiz/lite is competitive because its output cost is only $0.42 per million tokens. You can learn more about how multi-model routing operates in our guide to one API key for GPT, Claude and Gemini.

How far does the $2 trial credit go?

A new account on thelastapi starts with $2 of trial credit. Because model pricing is measured in fractions of a cent per thousand tokens, $2 covers substantial experimentation for coursework.

With $2 in your balance, you could run any of the following:

  • 20 million input tokens on vibiz/fast or vibiz/smart-mini (roughly 15 million words of text).
  • 4 million output tokens on vibiz/fast or vibiz/smart-mini (about 3 million words of generated text).
  • 4.7 million output tokens on vibiz/lite.
  • 100 million tokens of embeddings on vibiz/embed for vector search assignments.

For most semester projects, this initial credit covers development, testing, and your final presentation. If you eventually need more credit, you can top up by card starting at $5 under Billing and credits.

How to cap your spending so you never get surprised

The biggest risk in a student project is an accidental while loop that calls an API hundreds of times in a minute. Without safeguards, an automated script can run up unexpected bills overnight.

thelastapi prevents this with two built-in safety ceilings:

  1. Daily project budget ($1 default): Each project can only spend $1 per UTC day by default. If your code hits that ceiling, the gateway returns HTTP 429 with details.reason: "project_budget" instead of continuing to spend money.
  2. Daily account safety cap ($5 default): Across all projects, your account cannot spend more than $5 in a UTC day unless you explicitly raise the limit in Billing.

You can view or adjust your project's daily AI budget using the CLI:

Terminal
vibiz ai budget 1.00 --project prj_123

You can also set a budget per end user if your school demo is shared with classmates. Pass a stable user id in the user field of the request, or configure end_user_daily_budget_usd on the project. When any budget limit reaches 80% and 100%, an automated email alert warns you before service pauses. You can read more about threshold enforcement in Usage and limits.

How to connect the API in code

The thelastapi gateway is OpenAI-compatible at /v1/ai. You do not need specialized libraries; you can use the standard OpenAI SDK in TypeScript or Python by setting baseURL and apiKey.

Setting up your environment

Start by initializing a project:

Terminal
vibiz init "Class Project" --resources ai
vibiz dev

The CLI writes your development credentials to .env.development.local, populating VIBIZ_AI_BASE_URL and VIBIZ_AI_API_KEY (along with OPENAI_BASE_URL and OPENAI_API_KEY).

Making a call in TypeScript

Here is a minimal script using the official OpenAI library:

TypeScript
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: process.env.VIBIZ_AI_BASE_URL,
  apiKey: process.env.VIBIZ_AI_API_KEY,
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: 'vibiz/fast',
    messages: [
      { role: 'system', content: 'You are a concise study tutor.' },
      { role: 'user', content: 'Explain binary search in two sentences.' },
    ],
    max_tokens: 200,
  });

  console.log(completion.choices[0]?.message.content);
}

main();

If your project uses @vibiz/app, you can pass vibiz.ai directly to new OpenAI(vibiz.ai) as detailed in the @vibiz/app documentation. For other budget-conscious project setups, see our guide on the cheapest way to use GPT and Claude through an API.

Making a call with curl

If your project is written in C, Java, or bash, call the endpoint directly:

Terminal
curl https://thelastapi.dev/v1/ai/chat/completions \
  -H "Authorization: Bearer $VIBIZ_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vibiz/smart-mini",
    "messages": [{"role": "user", "content": "Summarize Newton first law."}]
  }'

Every JSON response includes the exact micro-dollar cost in cost_micro_usd and the verified model that executed in served_model.

Running Google models at zero platform cost

If your university or department provides you with Google AI Studio credits, you can link your own Gemini API key. When you do, Google's models run against your personal Google key, and the cost on thelastapi is exactly zero.

Set your key in the terminal:

Terminal
GEMINI_API_KEY=your_key_here vibiz ai keys set google

Once linked, calls to vibiz/balanced (which runs on Gemini 3.8 Flash) or specific Google IDs like google/gemini-3.8-flash-tts cost $0 on your thelastapi balance. Each response returns "paid_by": "your_key". If your Google key is ever invalid or exhausted, the gateway fails immediately with provider_failed rather than falling back to paid platform credits without your knowledge. You can find key management details in Keys and environments.

Inspecting your token usage and per-call costs

When grading deadlines approach, tracking project expenses should take seconds. thelastapi logs every call with its cost, model name, and token count.

Check your usage from the command line:

Terminal
vibiz usage --period 7d --by model

To see real-time balance information:

Terminal
vibiz billing

If you expand your assignment into a web app with user sign-in and storage, check out our guide on the cheapest way to host a website and database for a side project or see how small models handle user interactions in which model is cheapest for a customer support chatbot?.

To get started on your assignment, review the endpoint specifications on the AI documentation page, set up your project with vibiz init, and use your included $2 trial credit to build your app.

Frequently asked questions

Can a bug in my code charge my credit card without my permission?

No. thelastapi accounts are prepaid, and new accounts start with $2 of credit. Additionally, a default $1 daily project budget and a $5 daily account ceiling stop unexpected spend by returning HTTP 429 when hit.

What happens if I exceed my project's daily budget during testing?

The API returns an HTTP 429 error with the reason `project_budget`. You can wait until midnight UTC for it to reset or raise the project budget using `vibiz ai budget <dollars>`.

Can I use the Python OpenAI library with thelastapi?

Yes. You can point the standard OpenAI Python client to thelastapi by setting `base_url` to the value of `VIBIZ_AI_BASE_URL` and `api_key` to your project's AI key.

Does the gateway switch to another model if the cheapest model is busy?

No. thelastapi never silently substitutes models; if a model is unavailable, the API returns a 503 error code so your behavior and costs remain entirely predictable.