Get up and running with Forii. You’ll make your first inference request before the page finishes loading.
Step 1: Get your API key
Sign up at app.forii.in
Navigate to Dashboard → API Keys
Click Create New Key
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.
No installation needed. cURL is pre-installed on macOS and Linux.
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 " \n Tokens: { response.usage.total_tokens } " )
import OpenAI from "openai" ;
const client = new OpenAI ({
apiKey: process . env . FORII_API_KEY ,
baseURL: "https://api.forii.in/inference/v1" ,
});
const response = await 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 ,
});
console . log ( response . choices [ 0 ]. message . content );
console . log ( ` \n Tokens: ${ response . usage . total_tokens } ` );
curl https://api.forii.in/inference/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $FORII_API_KEY " \
-d '{
"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
}'
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 = "" )
const stream = await client . chat . completions . create ({
model: "forii/deepseek-v3" ,
messages: [{ role: "user" , content: "Tell me a story" }],
stream: true ,
});
for await ( const chunk of stream ) {
process . stdout . write ( chunk . choices [ 0 ]?. delta ?. content || "" );
}
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.