EN ▾
Get API key

getdeepseekapi.comGuide

DeepSeek API URL and Base URL: How to Switch

The deepseek api url you copy from DeepSeek's own docs is a base URL, and it works only with DeepSeek's key and DeepSeek's models. If you want a different OpenAI-style endpoint, you change that one URL, the key and the model ID.

Updated

Key points

  • A base URL is the prefix; the SDK adds /chat/completions to it.
  • This service uses https://api.getdeepseekapi.com/v1 with model ID uncensored.
  • It is not DeepSeek's API, so a DeepSeek key will not work here and the reverse.
  • Most clients also accept the URL and key through OPENAI_BASE_URL and OPENAI_API_KEY.
Railway switch redirecting a glowing track to a different server, illustrating swapping an API base URL

Base URL, endpoint and path: the three parts

People often paste a full address into a field that expects a prefix, and then get a 404. Three terms keep this straight.

  • Base URL: the shared prefix of every call, for example https://api.getdeepseekapi.com/v1. This is what you put in the "API base" or "Base URL" setting of a client.
  • Endpoint path: the part added by the SDK, such as /chat/completions, /responses or /models.
  • Full URL: base plus path, such as https://api.getdeepseekapi.com/v1/chat/completions. Raw HTTP clients like curl need this one.

The rule that catches most people: SDKs and apps ask for the base URL, curl and HTTP nodes ask for the full URL. If a tool gives a 404, check first whether you put a full URL where a base was expected, or the other way round. A doubled path such as /v1/chat/completions/chat/completions in the error is the giveaway.

What the DeepSeek base URL is, and what it is not

DeepSeek publishes its own API address in its documentation, together with the model names its key can use. Look there for the current value instead of trusting a blog post, including this one. A DeepSeek key works against DeepSeek's endpoint and nowhere else.

The service on this site is a separate product. It is not the official DeepSeek API, does not forward to DeepSeek and does not serve DeepSeek models. It is a hosted, OpenAI-compatible API for one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. Its address is:

https://api.getdeepseekapi.com/v1   # model: uncensored

The model ID is uncensored, and authentication is Authorization: Bearer <key>. Keys are issued on the API key page. If you are comparing what a key means for each service, the page on the DeepSeek API key has more detail.

Switching endpoints in the OpenAI SDKs

Any OpenAI SDK works once you change the base URL and the key. In Python:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.getdeepseekapi.com/v1",
    api_key="YOUR_KEY",
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Name three uses for a base URL."}],
)
print(resp.choices[0].message.content)

In Node.js the field is spelled baseURL:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.getdeepseekapi.com/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Name three uses for a base URL." }],
});
console.log(resp.choices[0].message.content);

Note the difference: Python uses base_url, Node uses baseURL. Mixing them up silently falls back to the default OpenAI address, which then rejects your key.

Switching without touching code

The official OpenAI SDKs read two environment variables, so an existing app can be repointed with no code change:

export OPENAI_BASE_URL="https://api.getdeepseekapi.com/v1"
export OPENAI_API_KEY="YOUR_KEY"
python app.py   # the app still has to request model "uncensored"

The model name is the part you cannot skip. If the app hard-codes another model ID, it will ask for that one and fail, so change it to uncensored in the app's settings or config. Many tools expose all three values in one settings screen, usually labelled API base, API key and model.

The same three-value swap works in frameworks. With LangChain in Python, for example, ChatOpenAI(base_url="https://api.getdeepseekapi.com/v1", api_key="YOUR_KEY", model="uncensored") is enough. Coding tools that accept an OpenAI-compatible endpoint work the same way; see the walkthrough on using an API for coding.

Raw HTTP: the exact paths

For curl, scripts and HTTP nodes you build the full URL yourself. These are the paths on this service:

PurposeMethod and URL
ChatPOST https://api.getdeepseekapi.com/v1/chat/completions
Responses APIPOST https://api.getdeepseekapi.com/v1/responses
Model listGET https://api.getdeepseekapi.com/v1/models
BalanceGET https://api.getdeepseekapi.com/v1/balance
Balance, OpenAI styleGET https://api.getdeepseekapi.com/v1/dashboard/billing/credit_grants
curl https://api.getdeepseekapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"ping"}]}'

Use HTTPS only. Streaming works with "stream": true over server-sent events, and the same URL serves both modes.

Entering the URL in apps with a settings screen

Many chat front ends, editors and automation tools have a "custom OpenAI-compatible endpoint" option. The labels differ, but the fields map one to one:

Field in the appValue
API base, Base URL, Endpoint, Server URLhttps://api.getdeepseekapi.com/v1
API key, Token, SecretYour key from this service
Model, Model name, Model IDuncensored

Some apps want a full chat URL rather than a base. In that case use https://api.getdeepseekapi.com/v1/chat/completions. If the app has a "test connection" button, it usually calls the model list, which is GET /v1/models. If the button fails but a manual chat works, the app's check is stricter than the API, and you can ignore it.

A quick sanity test of the URL alone

Before you debug an app, prove the URL with the model list. It needs no body and costs nothing:

curl -s https://api.getdeepseekapi.com/v1/models   -H "Authorization: Bearer $API_KEY"   # the chat model ID is uncensored

You should get JSON back with a data array. An HTML error page means a wrong host or path, such as a missing subdomain: the host starts with api., not www..

Fixing the usual mistakes

  • 404 Not Found. The base URL is missing /v1, has it twice, or includes the endpoint path.
  • 401 or an authentication error. You used a key from another service, or the header lacks Bearer. Keys are not interchangeable between providers.
  • Model not found. The request still names a model from the old provider. Set uncensored.
  • The app still talks to the old service. Some tools cache settings or read a different variable. Restart the process and check the settings screen.
  • A trailing slash problem. Most clients cope, but if one does not, remove the final slash from the base URL.

If you are not sure which side is failing, send the curl command above. A 200 reply proves the URL, key and model; whatever else breaks is in your app. The documentation lists limits and headers such as X-Request-Id, which helps when you contact support.

What stays the same after the switch

Request and response shapes follow the OpenAI format, so message arrays, temperature, top_p, stop, seed, penalties, tool calling and JSON mode all work as usual. The context window is 100,000 tokens for prompt plus completion, and the maximum request body is 8 MB. The service is text only: no images, audio, embeddings or fine-tuning, so features built on those need a different provider.

Billing is separate from the old provider too: $0.15 per 1M input tokens and $0.50 per 1M output tokens from prepaid credit, as shown on the pricing page. New users can claim $0.50 of trial credit to check the switch works before paying anything.

Questions and answers

What is the DeepSeek API base URL?

DeepSeek publishes it in its own documentation, so check there for the current value. The endpoint on this site is a different service at https://api.getdeepseekapi.com/v1.

Can I use a DeepSeek key on this endpoint?

No. Keys are issued per service. Get a key for this API on the key page, and set the model to uncensored.

Should the base URL end in /v1?

Yes for this service: https://api.getdeepseekapi.com/v1. SDKs add the endpoint path after it, so do not add /chat/completions yourself.

Why do I get 404 after changing the URL?

Usually the path is doubled or /v1 is missing. Compare your base URL with the exact value above.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key