> ## Documentation Index
> Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Sandbox tokens let you test your integration without real provider calls and at no cost.

export const TechArticleSchema = ({title, description, path, articleSection, about, proficiencyLevel = "Beginner", dependencies, keywords = [], datePublished, dateModified, image, inLanguage = "en"}) => {
  const baseUrl = "https://www.edenai.co/docs";
  const canonicalUrl = `${baseUrl}/${path}`.replace(/\/+$/, "");
  const ogParams = new URLSearchParams({
    division: articleSection || "",
    title: title || "",
    description: description || ""
  });
  const resolvedImage = image || `https://edenai.mintlify.app/_mintlify/api/og?${ogParams.toString()}`;
  const data = {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    "@id": `${canonicalUrl}#techarticle`,
    mainEntityOfPage: {
      "@type": "WebPage",
      "@id": canonicalUrl
    },
    headline: title,
    name: title,
    description: description,
    url: canonicalUrl,
    inLanguage: inLanguage,
    isPartOf: {
      "@type": "WebSite",
      name: "Eden AI Documentation",
      url: baseUrl
    },
    author: [{
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/"
    }],
    publisher: {
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/",
      logo: {
        "@type": "ImageObject",
        url: "https://www.edenai.co/assets/logo.png"
      }
    }
  };
  if (articleSection) data.articleSection = articleSection;
  if (about) data.about = {
    "@type": "Thing",
    name: about
  };
  if (proficiencyLevel) data.proficiencyLevel = proficiencyLevel;
  if (dependencies) data.dependencies = dependencies;
  if (keywords && keywords.length) data.keywords = keywords;
  if (datePublished) data.datePublished = datePublished;
  if (dateModified) data.dateModified = dateModified;
  data.image = Array.isArray(resolvedImage) ? resolvedImage : [resolvedImage];
  const json = JSON.stringify(data);
  const schemaId = `techarticle-${canonicalUrl}`;
  React.useEffect(() => {
    if (typeof document === "undefined") return;
    document.querySelectorAll(`script[data-schema-id="${schemaId}"]`).forEach(n => n.remove());
    const script = document.createElement("script");
    script.type = "application/ld+json";
    script.dataset.schemaId = schemaId;
    script.textContent = json;
    document.head.appendChild(script);
    return () => script.remove();
  }, [json, schemaId]);
  return null;
};

<TechArticleSchema title={"Sandbox"} description={"Sandbox tokens let you test your integration without real provider calls and at no cost."} path="v3/general/sandbox" articleSection="General" about={"API Configuration"} proficiencyLevel="Intermediate" keywords={["Eden AI", "AI API", "rate limits", "billing", "monitoring"]} datePublished="2026-05-06T00:00:00Z" dateModified="2026-05-07T00:00:00Z" />

Sandbox tokens let you **test your integration without real provider calls and at no cost**. Requests made with a sandbox token return simulated data, so you can build and validate your workflow before going to production.

## Token Types

Eden AI supports two token types:

| Token Type          | Purpose                 | Real Provider Calls | Cost        |
| ------------------- | ----------------------- | ------------------- | ----------- |
| `api_token`         | Production use          | Yes                 | Pay-per-use |
| `sandbox_api_token` | Testing and development | No                  | Free        |

When you use a sandbox token, Eden AI returns **mock responses** that match the real response structure. This means your code works the same way in development and production — you just swap the token.

## Creating a Sandbox Token

You can create sandbox tokens from the [Eden AI dashboard](https://app.edenai.run/) under **API Keys**, or programmatically via the API:

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.edenai.run/v2/user/custom_token/"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  payload = {
      "name": "dev-testing",
      "token_type": "sandbox_api_token"
  }

  response = requests.post(url, headers=headers, json=payload)
  sandbox_token = response.json()
  print(f"Sandbox token: {sandbox_token['token']}")
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.edenai.run/v2/user/custom_token/ \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "dev-testing",
      "token_type": "sandbox_api_token"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.edenai.run/v2/user/custom_token/', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'dev-testing',
      token_type: 'sandbox_api_token'
    })
  });

  const sandboxToken = await response.json();
  console.log(`Sandbox token: ${sandboxToken.token}`);
  ```
</CodeGroup>

## Using a Sandbox Token

Usage is identical to a production token — just use the sandbox token in the `Authorization` header:

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.edenai.run/v3/chat/completions"
  headers = {
      "Authorization": "Bearer YOUR_SANDBOX_TOKEN",
      "Content-Type": "application/json"
  }

  payload = {
      "model": "openai/gpt-4",
      "messages": [
          {"role": "user", "content": "Hello!"}
      ]
  }

  response = requests.post(url, headers=headers, json=payload)
  result = response.json()

  # Returns simulated data — same structure as a real response
  print(result["choices"][0]["message"]["content"])
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.edenai.run/v3/chat/completions \
    -H "Authorization: Bearer YOUR_SANDBOX_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-4",
      "messages": [{"role": "user", "content": "Hello!"}]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.edenai.run/v3/chat/completions', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_SANDBOX_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      model: 'openai/gpt-4',
      messages: [{role: 'user', content: 'Hello!'}]
    })
  });

  const result = await response.json();
  console.log(result.choices[0].message.content);
  ```
</CodeGroup>

## Multi-Environment Setup

A common pattern is to create one sandbox token per environment and swap to a production token when you go live:

<CodeGroup>
  ```python Python theme={null}
  import os

  # Use a sandbox token in dev/staging, a real token in production
  EDENAI_TOKEN = (
      os.getenv("EDENAI_SANDBOX_TOKEN")
      if os.getenv("ENV") != "production"
      else os.getenv("EDENAI_API_TOKEN")
  )

  headers = {"Authorization": f"Bearer {EDENAI_TOKEN}"}
  ```

  ```javascript JavaScript theme={null}
  const token =
    process.env.ENV !== 'production'
      ? process.env.EDENAI_SANDBOX_TOKEN
      : process.env.EDENAI_API_TOKEN;

  const headers = { Authorization: `Bearer ${token}` };
  ```
</CodeGroup>

You can create multiple sandbox tokens — one per app or environment — from the dashboard or via the API with different `name` values.

## When to Use Sandbox Tokens

<CardGroup cols={2}>
  <Card title="Development" icon="code">
    Build and iterate on your integration without spending credits.
  </Card>

  <Card title="CI/CD Pipelines" icon="rotate">
    Run automated tests against the API without incurring costs.
  </Card>

  <Card title="Demos" icon="presentation-screen">
    Show your integration to stakeholders with predictable responses.
  </Card>

  <Card title="Prototyping" icon="lightbulb">
    Validate your architecture and request flow before going live.
  </Card>
</CardGroup>

<Note>
  Sandbox tokens return simulated data. The response structure matches production responses, but the actual content is mock data. Do not use sandbox tokens to evaluate model quality or accuracy.
</Note>
