Skip to main content
Get up and running with Forii. You’ll make your first inference request before the page finishes loading.

Step 1: Get your API key

  1. Sign up at app.forii.in
  2. Navigate to Dashboard → API Keys
  3. Click Create New Key
  4. Copy the key — it starts with forii_sk_ and is shown only once
Your free tier includes ₹50 in credits — enough for thousands of inference calls. No credit card needed to start.

Step 2: Install the SDK

Forii is OpenAI-compatible. Use the official OpenAI SDK — no Forii SDK needed.
pip install openai

Step 3: Make your first request

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.forii.in/inference/v1",
    api_key=os.environ["FORII_API_KEY"],
)

response = client.chat.completions.create(
    model="forii/deepseek-v3",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing in simple terms"},
    ],
    temperature=0.7,
    max_tokens=512,
)

print(response.choices[0].message.content)
print(f"\nTokens: {response.usage.total_tokens}")

Step 4: Stream a response

stream = client.chat.completions.create(
    model="forii/deepseek-v3",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

What’s next?

Chat Completions

Full reference for all completion modes — streaming, structured outputs, function calling.

Models

Browse available models, context windows, and pricing.

Pricing

INR pricing, credits system, and plans — frontier models at 30% lower cost.