Introduction to SUTRA

SUTRA Cookbooks

SUTRA is a family of large multi-lingual language (LMLMs) models developed by TWO AI. SUTRA’s dual-transformer extends the power of both MoE and Dense AI language model architectures, delivering cost-efficient multilingual capabilities. It powers scalable AI applications for conversation, search, and advanced reasoning, ensuring high-performance across diverse languages, domains and applications. SUTRA support 50+ languages including Hindi, Gujarati, Korean, Arabic, Japanese, and more.SUTRA’s innovative dual-transformer (D2T) architecture decouples concept learning from language learning, enabling faster training cycles, cost-efficient inference, and powering advanced multilingual language and prediction models.

SUTRA models are ultra-fast, inference cost-efficient and flexible. Get started with an easy to use API and End-to-end Enterprise AI solutions via SUTRA Enterprise platforms.

Key Capabilities

  • Multilingual: Fluent in 50+ languages, including Hindi, Gujarati, Korean, Japanese, and more.
  • Efficient Tokenization: Cuts token usage by 3–5x for non-English languages—reducing costs.
  • Advanced Reasoning: Excels at logic-driven tasks and multi-turn conversations with SUTRA-R0.
  • API Compatibility: Works seamlessly with OpenAI-compatible APIs and tools.
  • Ecosystem Support: Integrates with LangChain, CrewAI, LiteLLM, and more.

Step 1: Get Started

  1. Sign up to receive free SUTRA API KEY.
  2. Explore SUTRA capabilities with ChatSUTRA.
  3. Start development by installing dependencies:
pip install openai
npm install openai
npm install openai react

Step 2: Basic Usage with SUTRA-V2

Once you have obtained an API key, you can access the SUTRA API using the example scripts below.
This is a non-stream example—set the stream parameter to true to receive a streaming response.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("SUTRA_API_KEY", "YOUR_SUTRA_API_KEY"),
    base_url="https://api.two.ai/v2"
)

response = client.chat.completions.create(
    model="sutra-v2",
    messages=[{"role": "user", "content": "Tell me about Mars exploration in three sentences."}],
    max_tokens=1024,
    temperature=0.7
)
print(response.choices[0].message.content)
import { OpenAI } from "openai";

async function main() {
  const client = new OpenAI({
    apiKey: process.env.SUTRA_API_KEY || "YOUR_SUTRA_API_KEY",
    baseURL: "https://api.two.ai/v2",
  });

  const response = await client.chat.completions.create({
    model: "sutra-v2",
    messages: [
      {
        role: "user",
        content: "Tell me about Mars exploration in three sentences.",
      },
    ],
    max_tokens: 1024,
    temperature: 0.7,
  });

  console.log(response.choices[0].message.content);
}

main();
import React, { useState } from "react";
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_SUTRA_API_KEY",
  baseURL: "https://api.two.ai/v2",
  dangerouslyAllowBrowser: true, // Note: Use a backend proxy in production
});

function App() {
  const [prompt, setPrompt] = useState("");
  const [response, setResponse] = useState("");

  const handleSubmit = async () => {
    try {
      const result = await client.chat.completions.create({
        model: "sutra-v2",
        messages: [
          {
            role: "user",
            content:
              prompt || "Tell me about Mars exploration in three sentences.",
          },
        ],
        max_tokens: 1024,
        temperature: 0.7,
      });
      setResponse(result.choices[0].message.content);
    } catch (error) {
      setResponse(`Error: ${error.message}`);
    }
  };

  return (
    <div style={{ padding: "20px" }}>
      <input
        type="text"
        value={prompt}
        onChange={(e) => setPrompt(e.target.value)}
        placeholder="Ask SUTRA-V2 about Mars exploration..."
      />
      <button onClick={handleSubmit}>Submit</button>
      <p>{response}</p>
    </div>
  );
}

export default App;

Resources

Follow @two_platforms and @sutra_dev on X (Twitter) for latest updates.