1. API 키 생성
IteraCompute 계정을 생성하거나 로그인한 다음 콘솔에서 키를 생성하세요.
IteraCompute 계정을 생성하거나 로그인한 다음 콘솔에서 키를 생성하세요.
IteraCompute baseURL을 사용하여 OpenAI 호환 제공자를 생성하고 해당 모델을 generateText에 전달합니다.
선택한 모델에 대한 정확한 API 모델 ID를 사용하세요.에이전트 또는 비전 기능을 활성화하기 전에 해당 컨텍스트와 기능을 확인하세요.
서버 환경이나 도구 자격 증명 저장소에 API 키를 보관하세요.해당하는 경우 예제 키 필드를 사용자 고유의 키로 바꿉니다.
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("Auto"),
prompt: "Reply with exactly: Hello!",
maxOutputTokens: 512,
});
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":"Auto","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512}'choices[0].message.content에 보이는 텍스트가 포함되어 있는지 확인하세요.HTTP 200만으로는 부족합니다.추론은 출력 예산을 소비할 수 있습니다.Auto을 사용하려면 다음을 사용하세요. 첫 Auto 요청 예시 를 확인한 후 도구에서 프롬프트를 보내세요.
macOS, Linux 또는 WSL의 Bash에는 cURL과 Python 3가 필요합니다. response.json은 로컬에 보관하세요.
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":"Auto","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512,"reasoning_effort":"low"}' \
-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)'Windows PowerShell 5.1 또는 PowerShell 7+의 기본 명령을 사용합니다. WSL, cURL, Python은 필요하지 않습니다.
$env:ITERACOMPUTE_API_KEY = "your-api-key"
$body = @{
model = "Auto"
messages = @(@{ role = "user"; content = "Reply with exactly: Hello!" })
max_tokens = 512
reasoning_effort = "low"
} | ConvertTo-Json -Depth 5
$response = Invoke-RestMethod -Method Post `
-Uri "https://api.iteracompute.com/v1/chat/completions" `
-Headers @{ Authorization = "Bearer $env:ITERACOMPUTE_API_KEY" } `
-ContentType "application/json" -Body $body -TimeoutSec 180 -ErrorAction Stop
$text = $response.choices[0].message.content
if ([string]::IsNullOrWhiteSpace($text)) {
throw "Empty model reply: activation is incomplete"
}
$textchoices[0].message.content에 비어 있지 않은 텍스트가 있으면 성공입니다. 이 명령은 텍스트를 출력하며 빈 응답이면 실패합니다. 등록 또는 HTTP 200만으로는 활성화가 완료되지 않습니다. 예상 출력: Hello! (표현은 달라질 수 있습니다).
사용량 페이지에서 Auto 잔여량을 확인하세요. 종량제를 직접 켜야 지갑에서 차감됩니다.
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.mjsNode.js 22 이상으로 서버에서 example.mjs를 실행하세요. API 키는 서버 환경 변수나 배포 시크릿에 저장하세요. 이 예제는 Chat Completions로 Auto를 호출합니다.
Hello!기능은 IteraCompute API의 지원 범위를 나타냅니다. 워크플로에서의 사용 가능 여부는 도구와 설정에도 달려 있으며, 추론 제어는 모델마다 다릅니다.
키의 Auto 권한과 요금제 토큰, 보상 또는 종량제 설정을 확인하세요.
OpenAI Compatible, /v1 기본 URL 및 Auto를 정확하게 사용하세요.채팅 완료 기능을 사용하세요.응답이 지원된다고 가정하지 마십시오.Qwen3.8-Max는 다른 유료 모델입니다.
현재 컨텍스트 길이와 최대 출력은 Auto 모델 상세 페이지에서 확인할 수 있습니다. 입력과 요청한 출력은 같은 컨텍스트 한도를 사용합니다.
사용량 페이지에서 Auto 잔여량을 확인하세요. 종량제를 직접 켜야 지갑에서 차감됩니다.
키의 Auto 권한과 요금제 토큰, 보상 또는 종량제 설정을 확인하세요.