DeepSeek

Last updated Sep 22, 2026 helps you build quickly with DeepSeek's advanced AI models.

Endpoint

https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek

Prerequisites

When making requests to DeepSeek, ensure you have the following:

  • Your AI Gateway Account ID.
  • Your AI Gateway gateway name.
  • An active DeepSeek AI API token.
  • The name of the DeepSeek AI model you want to use.

URL structure

Your new base URL will use the data above in this structure:

https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/.

You can then append the endpoint you want to hit, for example: chat/completions.

So your final URL will come together as:

https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions.

Examples

cURL with a provider key

Example fetch requestbash

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions \
 --header 'content-type: application/json' \
 --header 'Authorization: Bearer DEEPSEEK_TOKEN' \
 --data '{
    "model": "deepseek-chat",
    "messages": [
        {
            "role": "user",
            "content": "What is Cloudflare?"
        }
    ]
}'

cURL with stored keys (BYOK)

Store your DeepSeek key with bring your own keys (BYOK). Then omit the Authorization header so AI Gateway can substitute the stored key:

Example BYOK requestbash

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/chat/completions \
 --header 'content-type: application/json' \
 --header 'cf-aig-authorization: Bearer {CF_AIG_TOKEN}' \
 --data '{
    "model": "deepseek-chat",
    "messages": [
        {
            "role": "user",
            "content": "What is Cloudflare?"
        }
    ]
}'

Use DeepSeek with JavaScript

If you are using the OpenAI SDK, you can set your endpoint like this:

JavaScriptjs

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: env.DEEPSEEK_TOKEN,
    baseURL:
        "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek",
});

try {
    const chatCompletion = await openai.chat.completions.create({
        model: "deepseek-chat",
        messages: [{ role: "user", content: "What is Cloudflare?" }],
    });

    const response = chatCompletion.choices[0].message;

    return new Response(JSON.stringify(response));
} catch (e) {
    return new Response(e);
}

OpenAI-Compatible Endpoint

You can also access DeepSeek models using the OpenAI API schema through the REST API. Send your requests to:

https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/v1/chat/completions

Specify:

{
"model": "deepseek/{model}"
}

Was this helpful?

YesNo

On this page

DeepSeek - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/#page","headline":"DeepSeek","description":"Route DeepSeek API requests through AI Gateway for observability and control.","url":"https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/","inLanguage":"en","image":"https://developers.cloudflare.com/ai-gateway/usage/providers/deepseek/og.png?v=450c9f9ae7710409","dateModified":"2026-09-22","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Route ElevenLabs text-to-speech requests through AI Gateway for observability and control. title: ElevenLabs image: https://developers.cloudflare.com/ai-gateway/usage/providers/elevenlabs/og.png?v=9969223ef571665a


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ai-gateway/llms.txt
Use this file to discover all available pages before exploring further.