Skip to navigation

The Grid

Use The Grid instruments in Vapi through the custom-llm provider

The Grid is an inference marketplace that serves models from several labs behind one OpenAI-compatible API. Its instrument IDs describe capability tiers rather than specific lab models.

text-standard, code-prime, and agent-max each route to a current model for that tier. When The Grid replaces an underlying model, an assistant can keep using the same instrument ID.

The Grid exposes an OpenAI-compatible Chat Completions API, so you can connect it to Vapi as a custom LLM.

Before starting, create an account with The Grid and a Consumption API key.

Add your credential

Send the following body to POST https://api.vapi.ai/credential. Use your Vapi private API key in the Authorization: Bearer <VAPI_PRIVATE_KEY> header:

{
"provider": "custom-llm",
"apiKey": "<YOUR THE GRID API KEY>"
}

Save the credential id from the response. Add it to the assistant’s credentialIds to select that credential.

Create the assistant

Send this body to POST https://api.vapi.ai/assistant with the same Vapi private API key. Set model.url to The Grid’s base URL and model.model to an instrument ID:

{
"name": "My Assistant",
"credentialIds": ["<YOUR THE GRID CREDENTIAL ID>"],
"model": {
"provider": "custom-llm",
"url": "https://api.thegrid.ai/v1",
"model": "text-prime",
"metadataSendMode": "off",
"maxTokens": 600,
"messages": [
{
"role": "system",
"content": "You are a helpful voice assistant. Keep replies short."
}
]
}
}

Setting metadataSendMode to off keeps Vapi call metadata out of requests to The Grid.

Choose an instrument

GET https://api.thegrid.ai/v1/models lists available instrument IDs. Check instrument specifications and pricing for current details. Current instruments:

Capability tiers

InstrumentDescription
text-standardPrice-optimized models with low latency, high throughput, and shorter maximum outputs
text-primeReliable models for everyday text generation, editing, and analysis across diverse workflows
text-maxFrontier models for deep reasoning, long context, and complex workflows
agent-standardPrice-optimized models for fast tool calls, simple agent loops, high-throughput automation, and orchestration
agent-primeReliable models for dependable agentic applications, multi-step tool use, and reasoning workflows
agent-maxFrontier models for autonomous research, deep multi-step tool chains, and complex long-horizon tasks
code-standardPrice-optimized models for rapid autocomplete, linting, high-frequency suggestions, and batch edits
code-primeReliable models for everyday software tasks, code completion, review, and standard debugging
code-maxFrontier models for complex research, architectural decisions, debugging, and multi-file development

Latest-model aliases

Each alias follows the newest model release from one lab, with fallbacks to previous versions.

InstrumentDescription
bytedance-pro-latestLatest ByteDance Pro model release with fallbacks to previous versions for reliability
claude-opus-latestLatest Claude Opus model release with fallbacks to previous versions for reliability
deepseek-pro-latestLatest DeepSeek Pro model release with fallbacks to previous versions for reliability
gemini-pro-latestLatest Gemini Pro model release with fallbacks to previous versions for reliability
glm-latestLatest GLM model release with fallbacks to previous versions for reliability
gpt-sol-latestLatest OpenAI GPT Sol model release with fallbacks to previous versions for reliability
kimi-latestLatest Kimi model release with fallbacks to previous versions for reliability
minimax-latestLatest MiniMax model release with fallbacks to previous versions for reliability

Set maxTokens for spoken replies

Vapi uses 250 for maxTokens when it is omitted and sends the value to The Grid as max_tokens. A low cap can cut off a response.

The 600 value in the example is a starting point. Test your chosen instrument with representative spoken turns and raise the limit if replies are truncated. Keep the system prompt explicit about brevity.

Check the other model settings

In the Vapi Dashboard, open your assistant, select the Model card, and choose Custom LLM in the panel that opens. Check each setting against The Grid’s values. GET https://api.thegrid.ai/v1/models returns the current numbers for every instrument.

SettingWhat to set
ModelThe exact instrument ID, such as text-prime. Don’t use the display name.
Custom LLM URLhttps://api.thegrid.ai/v1
Max TokensAt or below the instrument’s max_completion_tokens. Vapi’s default of 250 suits short spoken replies.
Request TimeoutAbove the instrument’s grid.ttft_max_seconds, the longest time its providers can take to start streaming and still meet the specification. Vapi’s default is 20 seconds.
Metadata Send ModeOff — send only messages, to keep Vapi call metadata out of requests to The Grid.

Limits differ between instruments and change over time, so read them from GET https://api.thegrid.ai/v1/models instead of copying numbers into your configuration.

Tool calling

The Grid’s API supports OpenAI-style function calling. To configure Vapi tools, see the tool calling integration guide. Test a tool call with your chosen instrument before relying on it.

Verify the assistant

Start a test call and ask the assistant a short question. Confirm it speaks a complete answer. Check the call logs for custom LLM errors. If you attached a tool, request an action that uses it. Confirm the tool runs.