本文件尚未翻譯成繁體中文,現顯示英文原文。
Framework integrations
If it speaks OpenAI, it usually speaks to us
MyIP OpenRouter implements the OpenAI Chat Completions shape. That is why we ship no SDK of our own, and do not need one: anything that can be pointed at an OpenAI endpoint can be pointed at us.
The three settings that matter
Whatever the framework, only three values change.
| Setting (names vary by tool) | Value |
|---|---|
Base URL · base_url · baseURL · OPENAI_BASE_URL | https://openrouter.myip.co.kr/api/v1 |
API key · api_key · OPENAI_API_KEY | sk-mo-v1-… (issued at /settings/keys) |
| Model | google/gemma-4-26b-a4b or lgai/exaone-4.0-32b |
Our examples use the environment variable MYIP_API_KEY. If a tool only reads OPENAI_API_KEY, put our key there instead.
export OPENAI_BASE_URL="https://openrouter.myip.co.kr/api/v1"
export OPENAI_API_KEY="sk-mo-v1-..."Frameworks with a dedicated page
- OpenAI SDK — the official Python and TypeScript SDKs. Start here.
- Vercel AI SDK — via
@ai-sdk/openai-compatible - LangChain — point
ChatOpenAIat our base URL
Everything else
The tools below have no page of their own but connect with the same three settings. We do not ship or endorse an official integration for them; follow each tool's own documentation.
| Kind | How to configure |
|---|---|
| Coding agents and editor extensions | Choose the "OpenAI-compatible" / "Custom" provider and enter the base URL and key |
| Python agent frameworks | Inject our OpenAI client wherever the framework accepts one |
| Workflow automation tools | Call POST /api/v1/chat/completions directly from an HTTP node |
| Observability and tracing tools | Anything that wraps the OpenAI client works. We have no broadcast-style integrations of our own |
Check these before you connect
1. Is the endpoint one we implement?
We implement exactly these:
POST /api/v1/chat/completions
POST /api/v1/completions
GET /api/v1/models
GET /api/v1/models/{author}/{slug}/endpoints
GET /api/v1/generation
GET /api/v1/key · GET /api/v1/auth/key
GET /api/v1/credits
GET /api/v1/keys · GET/PATCH/DELETE /api/v1/keys/{hash} (management key)
GET /api/v1/providers
GET /api/v1/datasets/rankings-daily · /api/v1/datasets/app-rankings · /api/v1/benchmarksA tool that reaches for embeddings, images, audio, the Responses API, or Batch will get 404 not_supported for those features only. Full list: Unsupported endpoints.
2. Does the tool substitute its own model id?
Some tools fill in a default like gpt-4o when you select "OpenAI-compatible". That id is not in our catalogue, so you get 400 model_not_found. Make sure the model name is editable.
3. Does it assume USD?
Every amount we return is in Korean won (KRW). The pricing values from GET /api/v1/models are won per token, pricing.currency is "KRW", and the X-MyIP-Currency: KRW response header says the same. Cost displays written for openrouter.ai may read these numbers as dollars.
4. Are you using the right kind of key?
sk-mo-v1-…— inference keys, for chat and completion calls.sk-mo-mgmt-v1-…— management keys, only for the/keysroutes that create and delete keys.
Calling an inference endpoint with a management key returns 401 invalid_api_key.
Smoke test first
Checking with curl before wiring a framework removes half the possible problems.
curl https://openrouter.myip.co.kr/api/v1/chat/completions \
-H "Authorization: Bearer $MYIP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-4-26b-a4b",
"messages": [{"role": "user", "content": "ping"}]
}'Check the key itself:
curl https://openrouter.myip.co.kr/api/v1/key -H "Authorization: Bearer $MYIP_API_KEY"Attributing your apps
If several apps share one key, tell them apart with the HTTP-Referer and X-Title headers. Most SDKs expose a default-headers option. See App attribution.
When something breaks
| Symptom | Cause |
|---|---|
401 invalid_api_key | Wrong or revoked key, or a management key on an inference call |
400 model_not_found | The tool's default model id is not in our catalogue |
402 insufficient_credits | Balance exhausted — see Limits and 402 |
404 not_supported | An endpoint we do not implement |
503 model_loading | A local GPU model is still starting; retry shortly |
The error format and the full table are in Errors and debugging.
最後更新於 2026年9月5日