Skip to content
Docs

AI Gateway Disallow Prompt Training

No training on prompt data is available to all AI Gateway users at no extra charge. This feature ensures your prompts are not used by AI providers to train their models. There are two ways to enforce it:

  • Team-wide: Pro and Enterprise teams, and teams that have purchased AI Gateway credits, can enable it globally from the AI Gateway Dashboard Settings tab. Once enabled, all requests are routed only to providers that do not use your data for training.
  • Per-request: Set disallowPromptTraining: true in providerOptions for individual requests. This gives you fine-grained control over which requests disallow prompt training.

These two methods work as an OR: if either is enabled, disallow prompt training is enforced for that request. Neither method has an additional cost.

Disallow prompt training and Zero Data Retention (ZDR) are separate controls.

Disallow prompt training enforcement does not apply to BYOK (Bring Your Own Key) requests. When you use BYOK, this filter is not enforced since the request uses your own API key, your configuration, and agreement with the provider. However, if AI Gateway falls back to Vercel's provider keys, the disallow prompt training filter is honored on the failover request.

AI Gateway does not use your prompts or responses for training purposes. Your data is processed solely to fulfill your requests and is not retained for model improvement.

AI Gateway has agreements in place with specific providers regarding the use of prompt data for training. A provider's default policy may not match with the status that AI Gateway has in place due to these agreements.

By default, AI Gateway does not route based on the training data policy of providers.

If we do not know a provider's training data stance or have not yet established an agreement with them, we assume that they train on your data. If disallow prompt training is enabled on a request, it will not be routed through that provider.

Pro and Enterprise teams, and teams that have purchased AI Gateway credits, can enable disallow prompt training for all requests from the AI Gateway Dashboard. If your team stops being eligible while it's on, for example after downgrading from Pro, you can still turn it off.

To enable team-wide disallow prompt training:

  1. Go to the AI Gateway Dashboard
  2. Navigate to the Settings tab
  3. Toggle on the Disallow Prompt Training option

Once enabled, it applies to all requests through the Vercel team you configured it for, at no additional cost. Models with no compliant provider are also removed from your team's available model list (/v1/models) and from tools that read it, such as the model pickers in Codex and Claude Code.

Team-wide disallow prompt training and team-wide zero data retention are separate settings, and turning on one doesn't turn on the other. To enforce both for your team, turn on both toggles. Team-wide ZDR is billed at $0.10 per 1,000 requests.

As with per-request enforcement, team-wide disallow prompt training does not apply to BYOK requests, since those use your own API key, configuration, and agreement with the provider.

Set disallowPromptTraining to true in providerOptions to ensure requests are only routed to providers that do not use your data for training. If you are looking for controls that apply for all requests without configuration each time, see team-wide disallow prompt training. For a stronger guarantee that also covers data retention, see team-wide zero data retention.

If no compliant providers are available for the requested model, the request fails with an error:

{
  "error": "No providers that disallow prompt training available for model: example/model-name. Providers considered: provider-a, provider-b",
  "type": "invalid_request_error",
  "statusCode": 400
}

This filter also applies to any fallback providers.

This enforcement does not apply to BYOK requests since those use your own API key, configuration, and agreement with the provider. If AI Gateway falls back to Vercel's provider keys, it honors the disallow prompt training filter on the failover request.

These examples use AI SDK 7 and the AI SDK for Python beta. Set AI_GATEWAY_API_KEY before running them. See API format differences for setup, request fields, and response handling.

See the AI SDK prompt-training-filter reference for SDK configuration and usage.

disallow-training.ts
import { generateText } from 'ai';
 
const { text } = await generateText({
  model: 'anthropic/claude-sonnet-5',
  prompt: 'Explain quantum computing in two sentences.',
  providerOptions: {
    gateway: {
      disallowPromptTraining: true,
    },
  },
});
 
console.log(text);
disallow-training_ai.py
import asyncio
import ai
 
async def main():
    model = ai.get_model("anthropic/claude-sonnet-5")
    messages = [ai.user_message("Explain quantum computing in two sentences.")]
    params = ai.InferenceRequestParams(
        extra_body={"providerOptions": {"gateway": {"disallowPromptTraining": True}}}
    )
    async with ai.stream(model, messages, params=params) as stream:
        async for event in stream:
            if isinstance(event, ai.events.TextDelta):
                print(event.chunk, end="", flush=True)
    print()
 
asyncio.run(main())
disallow-training-chat.ts
import OpenAI from 'openai';
 
const client = new OpenAI({
  apiKey: process.env.AI_GATEWAY_API_KEY,
  baseURL: 'https://ai-gateway.vercel.sh/v1',
});
 
const response = await client.chat.completions.create({
  model: 'anthropic/claude-sonnet-5',
  messages: [
    {
      role: 'user',
      content: 'Explain quantum computing in two sentences.',
    },
  ],
  // AI Gateway extension fields are not included in the upstream SDK types.
  ...{
    providerOptions: {
      gateway: {
        disallowPromptTraining: true,
      },
    },
  },
});
 
console.log(response.choices[0]?.message.content);
disallow-training_chat.py
import os
from openai import OpenAI
 
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1",
)
 
response = client.chat.completions.create(
    model="anthropic/claude-sonnet-5",
    messages=[{"role": "user", "content": "Explain quantum computing in two sentences."}],
    extra_body={"providerOptions": {"gateway": {"disallowPromptTraining": True}}},
)
 
print(response.choices[0].message.content)
disallow-training-chat.sh
curl --fail-with-body https://ai-gateway.vercel.sh/v1/chat/completions -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -d '{
  "model": "anthropic/claude-sonnet-5",
  "messages": [
    {
      "role": "user",
      "content": "Explain quantum computing in two sentences."
    }
  ],
  "providerOptions": {
    "gateway": {
      "disallowPromptTraining": true
    }
  }
}'
disallow-training-messages.ts
import Anthropic from '@anthropic-ai/sdk';
 
const client = new Anthropic({
  apiKey: process.env.AI_GATEWAY_API_KEY,
  baseURL: 'https://ai-gateway.vercel.sh',
});
 
const response = await client.messages.create({
  model: 'anthropic/claude-sonnet-5',
  messages: [
    {
      role: 'user',
      content: 'Explain quantum computing in two sentences.',
    },
  ],
  max_tokens: 1024,
  ...{
    providerOptions: {
      gateway: {
        disallowPromptTraining: true,
      },
    },
  },
});
 
for (const block of response.content) {
  if (block.type === 'text') console.log(block.text);
}
disallow-training_messages.py
import os
from anthropic import Anthropic
 
client = Anthropic(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh",
)
 
response = client.messages.create(
    model="anthropic/claude-sonnet-5",
    messages=[{"role": "user", "content": "Explain quantum computing in two sentences."}],
    max_tokens=1024,
    extra_body={"providerOptions": {"gateway": {"disallowPromptTraining": True}}},
)
 
for block in response.content:
    if block.type == "text":
        print(block.text)
disallow-training-messages.sh
curl --fail-with-body https://ai-gateway.vercel.sh/v1/messages -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -H "anthropic-version: 2023-06-01" -d '{
  "model": "anthropic/claude-sonnet-5",
  "messages": [
    {
      "role": "user",
      "content": "Explain quantum computing in two sentences."
    }
  ],
  "max_tokens": 1024,
  "providerOptions": {
    "gateway": {
      "disallowPromptTraining": true
    }
  }
}'
disallow-training-responses.ts
import OpenAI from 'openai';
 
const client = new OpenAI({
  apiKey: process.env.AI_GATEWAY_API_KEY,
  baseURL: 'https://ai-gateway.vercel.sh/v1',
});
 
const response = await client.responses.create({
  model: 'anthropic/claude-sonnet-5',
  input: 'Explain quantum computing in two sentences.',
  ...{
    providerOptions: {
      gateway: {
        disallowPromptTraining: true,
      },
    },
  },
});
 
console.log(response.output_text);
disallow-training_responses.py
import os
from openai import OpenAI
 
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1",
)
 
response = client.responses.create(
    model="anthropic/claude-sonnet-5",
    input="Explain quantum computing in two sentences.",
    extra_body={"providerOptions": {"gateway": {"disallowPromptTraining": True}}},
)
 
print(response.output_text)
disallow-training-responses.sh
curl --fail-with-body https://ai-gateway.vercel.sh/v1/responses -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -d '{
  "model": "anthropic/claude-sonnet-5",
  "input": "Explain quantum computing in two sentences.",
  "providerOptions": {
    "gateway": {
      "disallowPromptTraining": true
    }
  }
}'

Disallow prompt training works alongside other filtering options like Zero Data Retention (ZDR). When multiple filters are enabled, they work as an AND: requests are only routed to providers that satisfy all enabled filters.

For example, if you enable both disallow prompt training and ZDR on a request, that request will only be routed to providers that meet both criteria.

The following providers currently support no training on prompt data on AI Gateway. Please review each provider's policy and terms carefully. A provider's default policy may not match with the status that AI Gateway has in place due to negotiated agreements. We are constantly coordinating and revising agreements to be able to enforce stricter training policies for customers. The full terms of service are available for each provider on the model pages.

ProviderNo prompt trainingPolicy
Alibaba Cloud✓Product terms
Anthropic✓Commercial terms
Azure✓Data privacy
Baseten✓Security
Bedrock✓Service terms
ByteDance✓Service terms
Cerebras✓Policies
Chutes✓Terms
Claude Platform on AWS✓Data policy
Cohere✓Privacy policy
DeepInfra✓Terms
DigitalOcean✓—
Fireworks✓Privacy policy
Google✓API terms
Google Vertex AI✓Zero data retention
Groq✓Security
Inception✓Enterprise
Inceptron✓Data policy
Interfaze✓Privacy policy
Kling AI✓Commercial terms
Meta✓Data policy
Mistral✓Commercial terms
Modal✓Terms of service
Moonshot AI✓Custom policy
Morph✓Terms of service
Nebius✓Terms of service
OpenAI✓API data policy
Parallel AI✓Customer terms
Parasail✓Privacy policy
Pareto Inference✓Trust center
Particle.AI✓Data policy
Perplexity✓Data collection
Prodia✓Privacy policy
Relace✓Data policy
Runware✓Data policy
Sakana AI✓Privacy policy
Together AI✓Terms of service
TypeSafe AI✓Data handling
Voyage AI by MongoDB✓Terms of service
Wafer✓Data processing addendum
xAI✓Terms of service

Vercel Token Pass models are served through the token-pass provider. Token Pass currently serves its models through Wafer and follows Wafer's data policy and terms.

A virtual model can restrict its traffic to providers that don't train on request data. The setting only tightens: either side can turn it on, and neither side can turn it off.

Last updated September 10, 2026

Was this helpful?

supported.