1. Create an API key
Create or sign in to your IteraCompute account, then create a key in the Console.
Build AI experiences in TypeScript.
Create or sign in to your IteraCompute account, then create a key in the Console.
Create an OpenAI-compatible provider with the IteraCompute baseURL and pass its model to generateText.
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 { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
if (!process.env.ITERACOMPUTE_API_KEY) {
throw new Error("Set ITERACOMPUTE_API_KEY on the server.");
}
const itera = createOpenAICompatible({
name: "iteracompute",
baseURL: "https://api.iteracompute.com/v1",
apiKey: process.env.ITERACOMPUTE_API_KEY,
});
const { text } = await generateText({
model: itera("qwen/qwen3.8-27b"),
prompt: "Reply with exactly: Hello!",
maxOutputTokens: 512,
providerOptions: { iteracompute: { chat_template_kwargs: { enable_thinking: false } } },
});
if (!text.trim()) throw new Error("Empty model reply: activation is incomplete.");
console.log(text);# 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.
export ITERACOMPUTE_API_KEY="your-api-key"
curl --fail-with-body --max-time 180 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,"chat_template_kwargs":{"enable_thinking":false}}' \
-o response.json && python3 -c 'import json; r=json.load(open("response.json")); text=r["choices"][0]["message"]["content"]; assert text and text.strip(), "Empty model reply: activation is incomplete"; print(text)'Success means a non-empty choices[0].message.content. This command prints it and fails on an empty reply; registration or HTTP 200 alone does not complete activation. Expected output: Hello! (wording may vary).
This Qwen example disables thinking for a short visible reply. 401/403: check the key and model permission. 429: check monthly usage and TPM in the Console, then honor Retry-After. Free capacity may queue; do not fire repeated parallel retries.
mkdir itera-ai-example
cd itera-ai-example
npm init -y
npm install ai@7.0.137 @ai-sdk/openai-compatible@3.0.67
export ITERACOMPUTE_API_KEY="your-api-key"
# Save the example above as example.mjs
node example.mjsUse Node.js 22 or newer. Run example.mjs on the server. Keep the key in a server environment variable or deployment secret; never use NEXT_PUBLIC_ or VITE_ for it, commit a .env file, or call the API from browser code. This sample uses Chat Completions with free Qwen; its thinking option is specific to Qwen3.8-27B.
Verified October 11, 2026 with Node.js 25.2.1, ai 7.0.137 and @ai-sdk/openai-compatible 3.0.67. Real API result: Hello! (leading whitespace omitted). The sample checks for a non-empty reply. This is a server-side CLI smoke test, not a hosted Vercel deployment test.
Hello!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.
Check the API key and permission for qwen/qwen3.8-27b. The Free tier does not require a balance or card. Other models may require paid balance.
Use OpenAI Compatible, the /v1 base URL and qwen/qwen3.8-27b exactly. Use Chat Completions; do not assume Responses support. Qwen3.8-2.4T-A95B is a different, paid model.
For Free, input plus requested max output must fit 131072 tokens. Reduce attached files/history or output budget. HTTP 200 with empty content is incomplete; try the short free-call example, which disables thinking.
Check account-wide monthly usage and TPM in the Console. Honor Retry-After and avoid parallel retries. Exhausted quota has no automatic paid overage; wait for the UTC monthly reset or unlock a higher tier with a top-up.
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.