questions/How-to

How do I use DeepSeek V4 Pro?

To use DeepSeek V4 Pro, install the OpenAI SDK (any language), point base_url at https://api.aigateway.sh/v1 with an sk-aig-... key, and set model="deepseek/deepseek-v4-pro". That's it — no provider account, no separate billing. Deepseek's model is served through AIgateway's OpenAI-compatible endpoint so every existing OpenAI integration (Cursor, LangChain, Vercel AI SDK) works unchanged.

How it works

1. Grab an AIgateway key

Sign in at aigateway.sh with GitHub or Google, open the dashboard, and copy an sk-aig-... key. A payment method is required to call the API — adding a card is free and never charges you, and grants $1 in credit across a curated trial catalog of 15 models led by GLM-5.2 and Kimi K2.7 Code. The $1 expires 30 days after you add the card.

2. Point the OpenAI SDK at AIgateway

Every OpenAI client library ships with a base_url (Python) or baseURL (Node) field. Set it to https://api.aigateway.sh/v1 and drop in your sk-aig-... key. Nothing else in your application code needs to change — the request and response schemas are OpenAI-identical.

3. Set model="deepseek/deepseek-v4-pro"

On your chat.completions.create call (or images, embeddings, audio — whichever endpoint matches the text modality), pass model="deepseek/deepseek-v4-pro". AIgateway handles provider auth, billing, retries, and transformation so Deepseek-specific quirks don't leak into your code.

Code example

Python
# pip install aigateway-py openai
# aigateway-py: sub-accounts, evals, replays, jobs, webhook verify.
# openai SDK: chat/embeddings/images/audio — drop-in compat per our SDK's own guidance.
from openai import OpenAI

client = OpenAI(
    base_url="https://api.aigateway.sh/v1",
    api_key="sk-aig-...",
)

r = client.chat.completions.create(
    model="deepseek/deepseek-v4-pro",
    messages=[{"role": "user", "content": "Explain vector databases in two sentences."}],
)
print(r.choices[0].message.content)
Node / TypeScript
// npm i aigateway-js openai
// aigateway-js: sub-accounts, evals, replays, jobs, webhook verify.
// openai SDK: chat/embeddings/images/audio — drop-in compat.
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.aigateway.sh/v1",
  apiKey: process.env.AIGATEWAY_KEY,
});

const r = await client.chat.completions.create({
  model: "deepseek/deepseek-v4-pro",
  messages: [{ role: "user", content: "Explain vector databases in two sentences." }],
});
console.log(r.choices[0].message.content);

Related

FAQ

Do I need a Deepseek account to use DeepSeek V4 Pro?

No. AIgateway provides a unified sk-aig-... key that routes to Deepseek on your behalf. You only need an AIgateway account.

Does DeepSeek V4 Pro support tool calling?

DeepSeek V4 Pro does not support tool calling natively. Use it for generation; route tool-calling prompts to a model like Claude Sonnet 4.6 or GPT-5.4.

What is the context window of DeepSeek V4 Pro?

DeepSeek V4 Pro supports a 131,072-token context window. Output is capped at 32,768 tokens per response.

Is DeepSeek V4 Pro free to try?

A payment method is required to call the API — adding a card is free and never charges you, and grants $1 in credit across a curated trial catalog of 15 models led by GLM-5.2. The $1 expires 30 days after you add the card. DeepSeek V4 Pro is not on that catalog; a $5 top-up unlocks the full catalog at pass-through pricing. Topups never expire.

Can I use DeepSeek V4 Pro with Cursor or LangChain?

Yes — anything that speaks OpenAI's API shape works. Set base_url to https://api.aigateway.sh/v1, paste your AIgateway key, and set the model string. Cursor, Cline, Continue, LangChain, LlamaIndex, Vercel AI SDK all supported.

TRY IT NOW

One key, every model. $1 free to start.

Get an AIgateway keyOpen the playground