API 문서

MeshTok은 100% OpenAI 호환 게이트웨이입니다. 이미 OpenAI를 호출하는 코드가 있다면 base_url과 API 키 두 가지만 변경하면 됩니다.

1. API 키 받기

Sign in to the 콘솔 and create a token. Your key looks like sk-xxxx....

2. Base URL

OpenAI 호환 (권장)
https://meshtok.com/v1
Use with OpenAI SDK, Cursor, Cline, Aider, and most tools. Covers all 175 models.
Anthropic 호환
https://meshtok.com
Use with Claude Code, Anthropic SDK, and tools that require the Anthropic Messages API format.

Most users only need the OpenAI-compatible endpoint. All endpoints follow the OpenAI convention: /v1/chat/completions, /v1/models, /v1/embeddings.

3. Python 예제

# pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://meshtok.com/v1",
    api_key="sk-your-MeshTok-key",
)

# any of 175 models -same code, just change the model name
resp = client.chat.completions.create(
    model="deepseek/deepseek-v4-pro",
    messages=[{"role":"user","content":"Explain quantum computing in one sentence."}],
)
print(resp.choices[0].message.content)

4. JavaScript 예제

// npm install openai
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://meshtok.com/v1",
  apiKey: "sk-your-MeshTok-key",
});

const resp = await client.chat.completions.create({
  model: "bigmodel/glm-5.2",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

5. 스트리밍

Add stream: true for Server-Sent Events streaming, identical to OpenAI's format.

curl https://meshtok.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-MeshTok-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Hi"}],"stream":true}'

6. 모든 모델 목록

curl https://meshtok.com/v1/models \
  -H "Authorization: Bearer sk-your-MeshTok-key"

Returns the full list of 175 available model IDs. Browse them visually on the models page.

기능 가이드

스트리밍 응답 →
OpenAI 형식의 Server-Sent Events. Python, JS, 원시 SSE 파싱.
도구 및 함수 호출 →
154개 모델이 당신의 함수를 호출하도록 하세요. 완전한 에이전트 루프, 병렬 호출.
구조화된 출력 →
유효한 JSON 강제. json_object 및 엄격한 json_schema 모드.
비전 및 이미지 입력 →
58개 비전 모델에 이미지 전송. URL, base64, OCR, 다중 이미지.
모델 폴백 →
랩 간 자동 장애 조치. 순차 및 병렬 패턴.
코딩 에이전트 및 IDE →
Claude Code, Cursor, Cline, Aider, Continue, Codex 설정.
멀티모달 입력 →
이미지, 오디오, 비디오, PDF — 69개 멀티모달 모델.

빌드할 준비가 되셨나요? API 키 받기