Published 2026-10-31 · Updated 2026-11-01
Documentation
Call IndicStack with your OpenAI SDK.
Base URL: https://api.indicstack.ai/v1. Create a key, then use the examples below from your server.
Get your API keyCreate a key and send a request.
- 01
Sign up
Create your IndicStack account.
- 02
Create a key
Store the key in your server environment.
- 03
Send a request
Use the IndicStack base URL and qwen38-27b.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.indicstack.ai/v1",
api_key=os.environ["INDICSTACK_API_KEY"],
)
response = client.chat.completions.create(
model="qwen38-27b",
messages=[{"role": "user", "content": "Explain what an API is."}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.indicstack.ai/v1",
apiKey: process.env.INDICSTACK_API_KEY,
});
const response = await client.chat.completions.create({
model: "qwen38-27b",
messages: [{ role: "user", content: "Explain what an API is." }],
});
console.log(response.choices[0].message.content);
curl https://api.indicstack.ai/v1/chat/completions \
-H "Authorization: Bearer $INDICSTACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen38-27b",
"messages": [{"role": "user", "content": "Explain what an API is."}]
}'
Install the OpenAI SDK: pip install openai, or npm install openai. Keep your key outside browser code and source control.
Stream the response as it arrives.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.indicstack.ai/v1",
api_key=os.environ["INDICSTACK_API_KEY"],
)
response = client.chat.completions.create(
model="qwen38-27b",
messages=[{"role": "user", "content": "Explain what an API is."}],
stream=True,
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.indicstack.ai/v1",
apiKey: process.env.INDICSTACK_API_KEY,
});
const response = await client.chat.completions.create({
model: "qwen38-27b",
messages: [{ role: "user", content: "Explain what an API is." }],
stream: true,
});
for await (const chunk of response) {
process.stdout.write(chunk.choices[0]?.delta.content || "");
}
curl -N https://api.indicstack.ai/v1/chat/completions \
-H "Authorization: Bearer $INDICSTACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen38-27b",
"messages": [{"role": "user", "content": "Explain what an API is."}],
"stream": true
}'
List models available to your key.
curl https://api.indicstack.ai/v1/models \
-H "Authorization: Bearer $INDICSTACK_API_KEY"Use the returned model ID in the model field of your request.
Define tools for Qwen3.8 27B.
The model returns tool calls. Your application validates the arguments, executes the function and supplies the result.
import json
# client is configured as in the quickstart
messages = [{"role": "user", "content": "What is the status of order 123?"}]
tools = [{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Look up an order by its ID",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
}]
response = client.chat.completions.create(
model="qwen38-27b", messages=messages, tools=tools,
)
message = response.choices[0].message
messages.append(message.model_dump(exclude_none=True))
for call in message.tool_calls or []:
args = json.loads(call.function.arguments)
# Validate args and look up the order in your application.
# This sample result is for demonstration only.
result = {"order_id": args["order_id"], "status": "processing"}
messages.append({
"role": "tool", "tool_call_id": call.id,
"content": json.dumps(result),
})
if message.tool_calls:
answer = client.chat.completions.create(
model="qwen38-27b", messages=messages,
)
print(answer.choices[0].message.content)Include an image in your request.
import base64
# client is configured as in the quickstart
with open("image.jpg", "rb") as image:
encoded = base64.b64encode(image.read()).decode("utf-8")
response = client.chat.completions.create(
model="qwen38-27b",
messages=[{"role": "user", "content": [
{"type": "text", "text": "Describe this image."},
{"type": "image_url", "image_url": {
"url": f"data:image/jpeg;base64,{encoded}"
}},
]}],
)
print(response.choices[0].message.content)Avoid common integration mistakes.
Keep API keys on your server, not in browser code. Check your credit balance before retrying failed requests. Choose an India‑hosted model when your workload requires inference in India; a Global model runs outside India.
Credit is zero
Calls stop until you top up.
Use one key per client.
- 01
Create a key
Open API Keys in the console.
- 02
Label the client
Keep its key in the application's server environment.
- 03
Track usage
Watch spend by key on the dashboard.
- 04
Remove access
Revoke the key when access is no longer needed.
Integration questions and failure handling
Check the request setup and operational behavior alongside the code examples.
Discuss your requirementsWhat base URL and credentials should I configure?
Sign up in the console, create a key, and configure your server's OpenAI SDK with https://api.indicstack.ai/v1 and your IndicStack key.
Where do I get the model identifier?
Start with qwen38-27b. The catalog and model pages describe availability; use the model ID in the request's model field.
How can I list available models?
Send an authenticated GET request to https://api.indicstack.ai/v1/models. The documentation includes the request format.
How do I enable streaming?
Set stream to true in your chat completions request and read the returned chunks. Python, Node.js and curl examples are provided above.
Which live model can take image inputs?
Qwen3.8 27B accepts text and image inputs. The image example shows how to include a local image as a base64 data URL.
Can the model call an application function?
Qwen3.8 27B supports tool calling. Supply tool definitions, execute the returned function request in your application, then return the tool result to the conversation.
What should I do when credit runs out?
Pay-as-you-go calls stop when your prepaid wallet reaches zero. Top up before making further pay-as-you-go calls. Paid packages still include unlimited tokens on Unlimited models.
How do I isolate usage for a client?
Create and label a key for the client in the console, keep it in that application's server environment, and monitor spend by key on the dashboard.
Make the first request from your server.
Create your key, set the base URL and use the request examples above.