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

# NinjaChat documentation

> Build with the NinjaChat API, connect your agent over MCP, and route requests across leading AI models.

<div className="ndoc">
  <div className="ndoc-intro">
    <div>
      <p className="ndoc-eyebrow">NINJACHAT / DOCUMENTATION</p>
      <h1>Chat, images & video.<br /><span>One API.</span></h1>
      <p className="ndoc-lead">Build with code, connect your agent, or route across models.</p>
    </div>

    <a className="ndoc-console" href="https://www.ninjachat.ai/developers/keys"><strong>Open developer console <span aria-hidden="true">↗</span></strong></a>
  </div>

  <div role="navigation" className="ndoc-paths" aria-label="Choose your starting point">
    <a className="ndoc-path" href="/quickstart">
      <div className="ndoc-art ndoc-art-api" aria-hidden="true">
        <div className="ndoc-code-window"><div className="ndoc-window-label"><span className="ndoc-status-dot" /> app.ts</div><code><span className="ndoc-code-soft">const</span> response = <span className="ndoc-code-soft">await</span><br />client.responses.create({'{'}<br />  model: <span className="ndoc-code-value">"ninja/auto"</span>,<br />  input: <span className="ndoc-code-value">"Let's build."</span><br />{'}'});</code><div className="ndoc-result"><span>200 OK</span></div></div>
      </div>

      <div className="ndoc-path-copy"><h2>Build with the API</h2><p>Generate text and media with TypeScript, Python or REST.</p><span className="ndoc-path-link">Make your first request <span aria-hidden="true">↗</span></span></div>
    </a>

    <a className="ndoc-path" href="/mcp/overview">
      <div className="ndoc-art ndoc-art-mcp" aria-hidden="true">
        <span className="ndoc-prompt-bubble">Make a campaign for this.</span>
        <div className="ndoc-media-card"><img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/007f6fb1/developer-campaign-shoe-blue.webp" alt="" width="220" height="150" /><span>Campaign / 01</span></div>
        <div className="ndoc-audio"><span>Voiceover</span><span className="ndoc-wave">▂ ▄ ▆ ▃ ▇ ▅ ▂ ▆ ▄ ▇ ▃ ▅</span></div>
      </div>

      <div className="ndoc-path-copy"><h2>Create with your agent</h2><p>Generate images, videos and voiceovers in Claude, ChatGPT or Codex.</p><span className="ndoc-path-link">Connect your agent <span aria-hidden="true">↗</span></span></div>
    </a>

    <a className="ndoc-path" href="/router/overview">
      <div className="ndoc-art ndoc-art-router" aria-hidden="true">
        <svg viewBox="0 0 360 210" fill="none">
          <path d="M0 106H116C159 106 140 40 190 40H360M0 106H360M0 106H116C159 106 140 171 190 171H360" stroke="currentColor" strokeWidth="1.5" />

          <path d="M0 106H116C159 106 140 40 190 40H360" stroke="#3888FF" strokeWidth="3" />

          <circle cx="248" cy="40" r="4" fill="#3888FF" />
        </svg>

        <span className="ndoc-route-node">ninja/auto</span>
      </div>

      <div className="ndoc-path-copy"><h2>Route across models</h2><p>Automatically select models for cost, speed and quality.</p><span className="ndoc-path-link">Explore routing <span aria-hidden="true">↗</span></span></div>
    </a>
  </div>

  <section className="ndoc-model-network">
    <div className="ndoc-section-heading"><div><h2>Models from leading AI labs</h2></div><a href="/models-overview">Explore the catalog <span aria-hidden="true">→</span></a></div>
    <div className="ndoc-brand-strip"><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/6cf26e8b/openai.svg" alt="" width="28" height="28" loading="lazy" /></span><span>OpenAI</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/4be04284/claude.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Claude</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/263e7dab/gemini.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Gemini</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/09b9d42e/bfl.png" alt="" width="28" height="28" loading="lazy" /></span><span>FLUX</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/86e0e433/bytedance.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Seedance</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/a4857841/kuaishou.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Kling</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/21c5faae/deepseek.svg" alt="" width="28" height="28" loading="lazy" /></span><span>DeepSeek</span></span><span className="ndoc-brand"><span className="ndoc-brand-mark">    <img src="https://cdn.photogenius.ai/new-ai-images/site/v1/landing/marks/marks/44c15113/qwen.svg" alt="" width="28" height="28" loading="lazy" /></span><span>Qwen</span></span></div>
  </section>

  <section className="ndoc-start">
    <div><h2>Make your first request</h2><p>Install an SDK and add your API key.</p><div className="ndoc-actions"><a className="ndoc-button" href="/quickstart">API quickstart <span aria-hidden="true">↗</span></a><a className="ndoc-text-link" href="/sdks">Browse SDKs <span aria-hidden="true">→</span></a></div></div>

    <div className="ndoc-start-code">
      <CodeGroup>
        ```typescript TypeScript theme={null}
        import { NinjaChat } from "@ninjachat/sdk";

        const client = new NinjaChat({
          apiKey: process.env.NINJACHAT_API_KEY,
        });

        const response = await client.responses.create({
          model: "ninja/auto",
          input: "Write a haiku about clean APIs.",
        });

        console.log(response.output_text);
        ```

        ```python Python theme={null}
        import os
        from ninjachat import NinjaChat

        client = NinjaChat(
            api_key=os.environ["NINJACHAT_API_KEY"]
        )
        response = client.responses.create(
            model="ninja/auto",
            input="Write a haiku about clean APIs.",
        )

        print(response["output_text"])
        ```
      </CodeGroup>
    </div>
  </section>

  <section className="ndoc-explore">
    <div className="ndoc-section-heading"><h2>Guides</h2></div>

    <div className="ndoc-guide-grid">
      <a href="/chat"><Icon icon="message" /><h3>Text generation</h3><span aria-hidden="true">↗</span></a>
      <a href="/image-generation"><Icon icon="image" /><h3>Image generation</h3><span aria-hidden="true">↗</span></a>
      <a href="/video-generation"><Icon icon="film" /><h3>Video generation</h3><span aria-hidden="true">↗</span></a>
      <a href="/mcp/voiceovers"><Icon icon="microphone" /><h3>Voiceovers</h3><span aria-hidden="true">↗</span></a>
      <a href="/search"><Icon icon="magnifying-glass" /><h3>Web search</h3><span aria-hidden="true">↗</span></a>
      <a href="/observability"><Icon icon="chart-line" /><h3>Usage & tracing</h3><span aria-hidden="true">↗</span></a>
    </div>
  </section>

  <Accordion title="More API capabilities">
    <div className="ndoc-guide-grid">
      <a href="/speech"><h3>Speech API</h3><span aria-hidden="true">↗</span></a>
      <a href="/embeddings"><h3>Embeddings</h3><span aria-hidden="true">↗</span></a>
      <a href="/reranking"><h3>Reranking</h3><span aria-hidden="true">↗</span></a>
      <a href="/batch"><h3>Parallel requests</h3><span aria-hidden="true">↗</span></a>
      <a href="/pipelines"><h3>Media pipelines</h3><span aria-hidden="true">↗</span></a>
      <a href="/compare"><h3>Compare models</h3><span aria-hidden="true">↗</span></a>
      <a href="/presets"><h3>Saved configurations</h3><span aria-hidden="true">↗</span></a>
      <a href="/sdks#search-and-webhooks"><h3>Webhooks</h3><span aria-hidden="true">↗</span></a>
      <a href="/management"><h3>Account management</h3><span aria-hidden="true">↗</span></a>
    </div>
  </Accordion>

  <div className="ndoc-migrate"><div><h2>Use your OpenAI SDK</h2><p>Update your base URL and API key to get started.</p></div><a className="ndoc-button ndoc-button-outline" href="/openai-compatibility">Migration guide <span aria-hidden="true">↗</span></a></div>
  <div role="navigation" className="ndoc-footer-links" aria-label="Documentation resources"><a href="/pricing">Pricing ↗</a><a href="/production-readiness">Go live →</a><a href="/error-handling">Troubleshooting →</a><a href="https://www.ninjachat.ai/changelog">Changelog ↗</a></div>
</div>
