연동 문서

OpenAI 방식 그대로 쓰면 돼요

OpenAI용 프로그램·라이브러리에 주소(Base URL)와 API 키만 바꿔 넣으면 됩니다. 모델 이름은 대시보드의 '지원 모델' 표에서 복사하세요.

기본 정보

Base URL
인증Authorization: Bearer gk-… (또는 x-api-key 헤더)
대화POST /v1/chat/completions stream 가능
모델 목록·단가GET /v1/models
클로드 전용POST /v1/messages (Anthropic 형식, 클로드 모델만)

curl

curl /chat/completions \
  -H "Authorization: Bearer $GUDOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"모델이름","messages":[{"role":"user","content":"안녕!"}]}'

Python (openai 라이브러리)

from openai import OpenAI
client = OpenAI(base_url="", api_key="gk-...")

r = client.chat.completions.create(
    model="모델이름",
    messages=[{"role": "user", "content": "안녕!"}],
)
print(r.choices[0].message.content)

Node.js

import OpenAI from "openai";
const client = new OpenAI({ baseURL: "", apiKey: "gk-..." });

const stream = await client.chat.completions.create({
  model: "모델이름", stream: true,
  messages: [{ role: "user", content: "안녕!" }],
});
for await (const c of stream) process.stdout.write(c.choices[0]?.delta?.content ?? "");

Anthropic 형식 (클로드 모델)

Anthropic 라이브러리나 Anthropic 형식을 쓰는 도구는 주소 끝의 /v1 을 빼고 넣으세요.

import anthropic
client = anthropic.Anthropic(base_url="", api_key="gk-...")
msg = client.messages.create(model="클로드모델이름", max_tokens=1024,
                             messages=[{"role": "user", "content": "안녕!"}])

요금과 크레딧

자주 나는 오류

401키가 틀렸거나 운영자가 껐어요.
402크레딧 부족.
404모델 이름이 목록에 없어요. 대시보드에서 복사해 쓰세요.
429 / 5xx공급사가 바쁘거나 오류. 잠시 뒤 다시 시도하세요.