API

VANTRA API

OpenAI-compatible chat completions, the Responses API and embeddings, with zero data retention. Coming from OpenAI? See the migration guide at vantra.cloud/docs/openai. If your code already uses the OpenAI SDK, change the base URL, the key and the model name, and keep the rest.

Keys are open to anyone signed in with Whop: make one on Your API, and your first key comes with $0.50 of free credit.

01Quickstart

Base URL: https://vantra.cloud/api/v1. Keep your key in an environment variable, never in your code.

curl
curl https://vantra.cloud/api/v1/chat/completions \
  -H "Authorization: Bearer $VANTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "core-apex",
    "messages": [{ "role": "user", "content": "Review this function for bugs: ..." }]
  }'
Python
# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://vantra.cloud/api/v1", api_key=os.environ["VANTRA_API_KEY"])

reply = client.chat.completions.create(
    model="core-apex",
    messages=[{"role": "user", "content": "Review this function for bugs: ..."}],
)
print(reply.choices[0].message.content)
TypeScript
// npm install openai
import OpenAI from 'openai'

const client = new OpenAI({ baseURL: 'https://vantra.cloud/api/v1', apiKey: process.env.VANTRA_API_KEY })

const reply = await client.chat.completions.create({
  model: 'core-apex',
  messages: [{ role: 'user', content: 'Review this function for bugs: ...' }],
})
console.log(reply.choices[0].message.content)

02API keys

Keys start with vk_ and go in the Authorization: Bearer header. We show a key once, when you create it, and store only a SHA-256 hash, so we can’t show it again. If a key leaks, press Replace next to it on Your API: you get a new secret for the same key, with its limit, models and expiry, and the old one stops working at once. You can also rename a key there, and change its limit, models and expiry; the secret stays the same.

API use is paid for with prepaid credit. If you have early access, make your own keys and buy credit ($5, $10 or $25, through Whop) on Your API; all your keys share one balance, and it never expires. No access yet? Join the waitlist. When the credit runs out, requests return 402 until it’s topped up. Your first key comes with $0.50 of free credit to try it.

When you make a key you can also limit it to certain models (say, only Core Embed for a search index) and give it an expiry date, after which it stops working on its own. You can give each key a monthly spending limit. Once a key has spent that much in a calendar month (UTC), its requests return 402 key_limit_reached until the 1st of the next month, or until you raise the limit. The limit is checked before each request, so the request that crosses it still finishes. Your API also has a playground for trying requests with your own key, and code for them in Python, JavaScript and curl.

The API also answers browsers (CORS is open), but never put a key in a public web page or app: anyone could copy it.

03Models

Prices per million tokens, input / output (Core Embed: input only). AI tools can read the OpenAPI spec or llms.txt. Core Nano isn’t hosted yet and returns 503 with how to run it free on your own computer. Core Summit is Studio-only, and VANTRA Chat is an early-access download for now; both return 403 here. GET /api/v1/models lists the API models and whether each is available now, and GET /api/v1/models/core-swift gives one (OpenAI’s models.retrieve()).

04Requests

POST /api/v1/chat/completions takes these fields. Anything else is ignored.

model
Required. core-apex or core-swift. (core-nano isn’t hosted yet; core-embed goes to /embeddings.)
messages
Required. A list of {role, content} with role system, user, assistant or tool. Content is text, or parts: text everywhere, pictures in user messages for Core Swift.
tools, tool_choice, parallel_tool_calls
Function calling, as with OpenAI: up to 128 functions. tool_choice is "auto", "none", "required" or a named function.
response_format
{"type": "json_object"} for JSON, or {"type": "json_schema", "json_schema": {...}} to match a schema.
max_tokens
Upper limit on the answer’s length. With thinking on, thinking counts toward it.
temperature, top_p, seed, stop
Sampling controls, passed to the model unchanged.
presence_penalty, frequency_penalty
Passed to the model unchanged.
n
How many answers to give, 1 to 4 (default 1). Each is written separately and billed as its own answer, prompt included. Streamed, they arrive side by side, each chunk tagged with its index.
reasoning_effort
Core Apex only: "low" or "high" turns thinking on. Core Swift always answers without thinking.
stream
true streams the answer as server-sent events. Text arrives a sentence at a time, after VANTRA has checked it; code arrives as it’s written.
stream_options
{"include_usage": true} adds token counts in a last chunk, as with OpenAI.

Each model has built-in instructions that come before your own system message, so it always knows what it is and what VANTRA promises.

Prefer OpenAI’s newer Responses API? POST /api/v1/responses works too, without stored responses (VANTRA keeps nothing, so send the whole conversation each time). Examples for it, the Vercel AI SDK, LangChain and LlamaIndex.

05Thinking

Core Apex answers straight away by default. For hard problems, ask it to think first. Thinking is slower and its tokens are billed as output, but you only get the final answer back.

Python
reply = client.chat.completions.create(
    model="core-apex",
    reasoning_effort="high",   # "low" or "high" turns thinking on; leave it out for a direct answer
    messages=[{"role": "user", "content": "Find the race condition in this code: ..."}],
)

06Tools

Give the model functions it can call, and it answers with tool_calls instead of text when it wants one. Run the function in your code, send the result back as a tool message, and the model carries on. It works on Core Apex and Core Swift, streamed or not, exactly as with OpenAI, so agent frameworks and the agent modes in editors work as they are.

Python
tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Current weather for a city",
        "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]},
    },
}]
messages = [{"role": "user", "content": "Is it raining in Paris?"}]

reply = client.chat.completions.create(model="core-apex", messages=messages, tools=tools)
call = reply.choices[0].message.tool_calls[0]          # get_weather({"city": "Paris"})

messages += [reply.choices[0].message,
             {"role": "tool", "tool_call_id": call.id, "content": '{"rain": false, "temp_c": 14}'}]
final = client.chat.completions.create(model="core-apex", messages=messages, tools=tools)
print(final.choices[0].message.content)

VANTRA passes tool calls through unchanged. Your functions run in your code, never on VANTRA’s servers.

07Pictures and JSON output

Core Swift reads pictures: add image_url parts to a user message, as an https:// address or a data: URL (PNG, JPEG, WebP or GIF), up to 20 per request. Core Apex is text only and answers 400 unsupported_content if you send it one.

Python
reply = client.chat.completions.create(
    model="core-swift",
    messages=[{"role": "user", "content": [
        {"type": "text", "text": "What's wrong with this layout?"},
        {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}},
    ]}],
)

For machine-readable answers, set response_format to json_object, or to json_schema with your schema. Both models support it.

Python
reply = client.chat.completions.create(
    model="core-swift",
    response_format={"type": "json_object"},
    messages=[{"role": "user", "content": "List three HTTP status codes for errors as JSON: {codes: [...]}"}],
)
data = json.loads(reply.choices[0].message.content)

08Embeddings

POST /api/v1/embeddings turns text into vectors for search, with core-embed (Qwen3-Embedding-8B): $0.02 per million input tokens, 4,096 dimensions, up to 32,768 tokens per text and 2,048 texts per request. Ask for smaller vectors with dimensions (32 to 4,096), and base64 output with encoding_format. Editors like Continue use it to search your codebase. Send text, not token IDs. Guides: see the editor guides.

Python
result = client.embeddings.create(
    model="core-embed",
    input=["def add(a, b): return a + b", "function add(a, b) { return a + b }"],
)
vectors = [d.embedding for d in result.data]   # 4,096 numbers each

09Responses and costs

Responses use the OpenAI chat-completion format, including usage with prompt and completion token counts. Two headers come with every answer:

  • x-vantra-request-id: a unique ID for the request, handy when you report a problem. We don’t store requests, so we can’t look one up, but it helps us match your report to the time and model.
  • x-vantra-cost-usd: what the request cost, in US dollars. Streamed answers don’t have it, because the cost is only known at the end; ask for include_usage to get the token counts.

10Errors

Errors come back as { "error": { "message", "type", "code" } }, like OpenAI’s. Error messages never repeat what you sent.

400invalid_json, invalid_messages, invalid_tools, invalid_response_format, invalid_input, model_not_found, wrong_endpoint, unsupported_content, context_length_exceededThe body isn’t JSON; messages, tools, response_format or the embedding input are malformed; the model ID is unknown or belongs to the other endpoint; a message has a picture for a model that can’t read them; or the input is too long for the model.
401missing_api_key, invalid_api_key, key_expiredNo key was sent, it is wrong or revoked, or it has passed the expiry date you set for it.
402insufficient_credit, key_limit_reachedYour prepaid API credit is used up (add more on Your API, vantra.cloud/studio/api), or this key has reached the monthly spending limit you set for it.
403studio_only, model_not_allowedThe model is only available in Studio (Core Summit, VANTRA Chat), or this key is limited to other models.
413request_too_largeThe request is over 4 MB.
429rate_limitedMore than 60 requests in a minute on one key. Wait for the retry-after header (60 seconds).
502backend_errorThe model host returned an error. Nothing was charged.
503model_unavailable, model_busyThe model isn’t hosted (Core Nano, which is free to run on your own computer with Ollama), or the model host is busy: retry after the retry-after header. Nothing was charged.
504backend_timeoutThe model host didn’t answer in time. Nothing was charged.

11Limits

  • 60 requests a minute per key, counted in whole UTC minutes. Every response carries x-ratelimit-limit-requests, x-ratelimit-remaining-requests and x-ratelimit-reset-requests (as OpenAI’s do, so the SDKs read them), and a 429 says when to retry. Ask us if you need more.
  • GET /api/v1/balance tells a key what it can still spend: your credit, this month’s spending on the key, its monthly limit, allowed models and expiry. It’s never charged.
  • GET /api/v1/requests is the key’s request log from the last 7 days, newest first: time, request ID, model, status, error code, tokens, cost and duration, never what was asked or answered. Add ?id= and an x-vantra-request-id to look one up, ?errors=true for failures only, and ?before= with the last at for the next page.
  • GET /api/v1/usage?days=30 lists the key’s requests, tokens and spending per UTC day and model, with totals (up to 90 days; or ?from=2026-11-01&to=2026-11-30). It only ever shows that key’s own use, and it’s never charged.
  • When your credit is under $1, every response carries x-vantra-credit-low: true, so a script can warn you before requests stop at $0. Falling below $1 is also recorded under Your data in Studio.
  • Context: 1M tokens on Core Apex, 256K on Core Swift, 32K on Core Nano. Core Embed takes up to 32,768 tokens per text and 2,048 texts per request.
  • Up to 128 tools and 20 pictures per request, and 4 MB per request in all.
  • Requests that wait more than three minutes for the model host are stopped and not charged.

12What VANTRA keeps

Your prompts, files and answers are handled in memory and never stored. For 7 days we keep each request’s time, model, result (status and error code), token counts, cost, duration and request ID, so you can see them under Recent requests on Your API. For billing we keep daily totals per model: the number of requests, the tokens and the cost. Nothing is used for training.

Two guards run on every answer. Questions about downloading VANTRA or about where your data goes get a fixed, accurate answer instead of a model’s guess, at no charge (not in requests with tools or JSON output, which always get the model’s own reply). Links to websites that pretend to be VANTRA are replaced with vantra.cloud. Code blocks and tool calls are never changed.