1. Create an API key
Create or sign in to your IteraCompute account, then create a key in the Console.
Build with Python and JavaScript.
Create or sign in to your IteraCompute account, then create a key in the Console.
Set base_url in Python or baseURL in JavaScript, then use Chat Completions.
Use the exact API Model ID for your chosen model. Check its context and capabilities before enabling agent or vision features.
Keep API keys in your server environment or tool credential store. Replace the example key field with your own key where applicable.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.iteracompute.com/v1",
api_key=os.environ["ITERACOMPUTE_API_KEY"],
)
response = client.chat.completions.create(
model="qwen/qwen3.8-27b",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=512,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
text = response.choices[0].message.content
if not text or not text.strip():
raise RuntimeError("Empty model reply: activation is incomplete.")
print(text)import OpenAI from "openai";
if (!process.env.ITERACOMPUTE_API_KEY) {
throw new Error("Set ITERACOMPUTE_API_KEY on the server.");
}
const client = new OpenAI({
baseURL: "https://api.iteracompute.com/v1",
apiKey: process.env.ITERACOMPUTE_API_KEY,
});
const response = await client.chat.completions.create({
model: "qwen/qwen3.8-27b",
messages: [{ role: "user", content: "Hello!" }],
max_tokens: 512,
chat_template_kwargs: { enable_thinking: false },
});
const text = response.choices[0].message.content;
if (!text || !text.trim()) throw new Error("Empty model reply: activation is incomplete.");
console.log(text);Python SDK 2.14.0 · Python 3.11.4 · October 15, 2026: request serialization and non-empty/empty reply handling checked with a local mock transport. This does not establish a real API call. JavaScript SDK version and end-to-end results are not yet recorded.
Run both SDK snippets. Each must print non-empty content; a missing key or an empty reply must stop the program.
python -m pip show openai
npm ls openaiTest the configured tool itself after the API check below. An HTTP 200 or a cURL result alone does not verify that tool.
# Bash / zsh / WSL; set ITERACOMPUTE_API_KEY in your environment first.
curl --fail-with-body https://api.iteracompute.com/v1/chat/completions \
-H "Authorization: Bearer $ITERACOMPUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"qwen/qwen3.8-27b","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512}'Check that choices[0].message.content contains visible text; HTTP 200 alone is insufficient. Reasoning may consume the output budget. For free Qwen, use the first free call example to disable thinking, then send a prompt inside your tool.
These are API capabilities of the selected model. Feature availability in your workflow also depends on the tool and its settings; reasoning controls vary by model.
Python uses base_url; JavaScript uses baseURL. Pass the IteraCompute key explicitly: the SDK default environment variable is not ITERACOMPUTE_API_KEY.
Call client.chat.completions.create and read choices[0].message.content. A Responses example and response.output_text are a different API; this guide does not establish Qwen Responses support.
An empty content field is not a successful text test. The free Qwen examples allow 512 output tokens and disable thinking. This parameter is model-specific.
Check account-wide monthly usage and TPM. Honor Retry-After and avoid parallel retries. Free Qwen has no automatic paid overage; other models use their published prices.
401 / 403: check the key and model permission. Free Qwen requires no balance or card. For paid models, also check available balance.
Connect your key, choose a model and send your first request.