Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.samuraiapi.in/llms.txt

Use this file to discover all available pages before exploring further.

One API, Unlimited Possibilities: Access GPT-4.1, Claude Opus 4, Gemini 2.5 Pro, and 400+ models without juggling multiple providers.

What is Samurai AI?

Samurai AI is your “super-API” for AI. Instead of integrating with OpenAI, Anthropic, Google, and other providers separately, you get access to all their models through one unified interface — at 50% of the original provider price.

Why Samurai AI?

  • 50% Cheaper: Pay half the provider price on every model, every time
  • Instant Model Switching: Change models with one parameter — no code rewrites
  • OpenAI Compatible: Drop-in replacement — just change base_url and go
  • 400+ Models: Chat, audio, embeddings — all in one API
  • Unified Billing: One invoice for all your AI usage

Quick Start

Quick Start

Get your API key and make your first request in minutes.

Authentication

Get your API key and start building.

Browse Models

GPT-4.1, Claude Opus 4, Gemini 2.5 Pro, and 400+ more.

API Playground

Test every endpoint live in your browser.

Core Features

50% Cheaper

gpt-4o for **1.25/1Mtokensvs1.25/1M tokens** vs 2.50 direct. claude-3-5-sonnet for **1.50/1Mvs1.50/1M** vs 3.00. Every model, every time.

OpenAI Compatible

Change base_url and your API key. SDKs, streaming, function calling, vision — all work exactly the same.

400+ Models

Chat, audio, embeddings — all in one API. New models added as they launch from providers.

Base URL

https://www.samuraiapi.in/v1
That’s the only change you need from OpenAI. Your existing code works as-is.

Who Uses Samurai AI?

Developers

  • Experiment with 400+ models without rewriting code
  • Reduce integration complexity from weeks to minutes
  • Build faster with one API key, one SDK, one invoice

Businesses

  • Cut AI costs by 50% immediately across every model
  • Ensure high availability for customer-facing AI features
  • Future-proof AI investments with provider flexibility

Researchers

  • Access cutting-edge models as they’re released
  • Run evaluations across GPT, Claude, Gemini, and more from one endpoint
  • Test model performance across different tasks without managing multiple accounts

Example: Switching Models

from openai import OpenAI

client = OpenAI(
    base_url="https://www.samuraiapi.in/v1",
    api_key="sk-samurai-YOUR_KEY"
)

# Use GPT-4.1 for complex reasoning
response = client.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "Analyze this data..."}]
)

# Switch to Claude Opus for creative writing
response = client.chat.completions.create(
    model="claude-opus-4-5",
    messages=[{"role": "user", "content": "Write a story about..."}]
)

# Use Gemini for large context tasks
response = client.chat.completions.create(
    model="gemini-2.5-pro",
    messages=[{"role": "user", "content": "Summarize this document..."}]
)
Use CasePrimary ModelWhy
Chatbotsgpt-4o-miniFast, cost-effective
Code Generationgpt-4.1Best code quality
Complex Analysisclaude-opus-4-5Superior reasoning
Creative Writingclaude-opus-4-5Creative excellence
Large Contextgemini-2.5-pro1M+ token context
Embeddingstext-embedding-3-smallFast, cheap vectors

Getting Started

Ready to go? Make your first API call in under 5 minutes.
1

Get API Key

Sign up for a Samurai AI account and get your API key from the dashboard.
2

Install SDK

Use the OpenAI SDK you already know — no new packages needed.
pip install openai
# or
npm install openai
3

Make Your First Request

Point to Samurai AI and start using any of 400+ models.
from openai import OpenAI

client = OpenAI(
    api_key="sk-samurai-YOUR_KEY",
    base_url="https://www.samuraiapi.in/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Need Help?