このページはまだ日本語に翻訳されていません。英語の原文を表示します。

GET and POST /keys

Listing and issuing keys with a management key

Lists the inference keys an account holds (GET) and issues new ones (POST). Both methods require a management key.

GET  https://openrouter.myip.co.kr/api/v1/keys
POST https://openrouter.myip.co.kr/api/v1/keys

Authentication — the most common mistake

Authorization: Bearer sk-mo-mgmt-v1-…, that is, a management key only. Calling with an inference key (sk-mo-v1-…) returns 401 invalid_api_key.

The two kinds do different jobs.

KeyPrefixCan call
Inference keysk-mo-v1-/chat/completions, /completions, /generation, /key, /credits
Management keysk-mo-mgmt-v1-/keys, /keys/{hash}, /key, /credits. Cannot run inference

Management keys cannot be created over the API. You issue one yourself in the dashboard under Settings → API keys by choosing the management kind. Letting a management key mint further management keys would mean a single leaked key has no recovery point.

GET /keys — list

Request parameters

None. The endpoint takes no query parameters.

openrouter's offset and include_disabled are not implemented. Our list returns all of the management key owner's inference keys in one response, newest first. Two things are never in it:

  • Revoked keys. They cannot be brought back, so there is nothing to show.
  • The management key itself. Only issued inference keys appear.

Keys the user has merely switched off (disabled: true), and keys stopped by an empty balance or by an administrator, all remain in the list and all show disabled: true.

Request example

curl https://openrouter.myip.co.kr/api/v1/keys \
  -H "Authorization: Bearer $MYIP_MANAGEMENT_KEY"

Response

{"data": [ … ]}, where each item is a key object with eight fields. POST /keys, GET /keys/{hash} and PATCH /keys/{hash} all return this same object.

created_atstring

Creation timestamp (ISO 8601).

updated_atstring | null

Last modification timestamp, or null if the key has never been edited.

hashstring

sha256(plaintext key) as 64 hex characters. This is the only address a key has and is used verbatim as the path segment in /keys/{hash}.

labelstring

The masked string sk-mo-v1-au7…890. It exists so a human can tell keys apart on screen; it cannot be used to authenticate.

namestring

The name given at creation.

disabledboolean

true means the key cannot run inference. It collapses several cases into one: the user switched it off, the balance ran out and the system suspended it, or an administrator suspended it. This field does not tell you which — send a request with that key and the status code will: 402 (a top-up fixes it) or 403 (only an administrator can).

limitnumber | null

Spend limit in won. null means unlimited.

usagenumber

Spend during the current limit_reset period, in won, with boundaries in Asia/Seoul; when the reset is never or unset this is the lifetime total. limit_reset itself is not part of this object — if you need it, read that key through GET /key.

Response example

json
{
  "data": [
    {
      "created_at": "2026-09-01T02:11:40.881Z",
      "updated_at": null,
      "hash": "9f2c1d0a7b3e4f5061728394a5b6c7d8e9f0112233445566778899aabbccddee",
      "label": "sk-mo-v1-au7…890",
      "name": "production",
      "disabled": false,
      "limit": 100000,
      "usage": 25500
    },
    {
      "created_at": "2026-08-20T11:05:02.130Z",
      "updated_at": "2026-08-29T09:41:18.004Z",
      "hash": "1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f809",
      "label": "sk-mo-v1-c3f…21b",
      "name": "staging",
      "disabled": true,
      "limit": null,
      "usage": 0
    }
  ]
}

POST /keys — issue

Creates a new inference key. There is no kind parameter, so this path cannot create management keys.

Request parameters

namestring必須

The key's name. An empty or whitespace-only string returns 400. Surrounding whitespace is trimmed before storing.

limitnumber | null

Spend limit as a number of Korean won. Omit it or pass null for unlimited. These are not dollars — 10 means ten won.

limit_resetstring | null

How often the limit resets: one of never, daily, weekly, monthly. Any other value returns 400. Omitted means null, and the limit then applies to lifetime spend. Boundaries are taken in Asia/Seoul.

Request example

curl -X POST https://openrouter.myip.co.kr/api/v1/keys \
  -H "Authorization: Bearer $MYIP_MANAGEMENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "batch-worker",
    "limit": 50000,
    "limit_reset": "monthly"
  }'

Response

dataobject

The key object just created — the same eight fields as in GET /keys. Being brand new, usage is 0 and updated_at is null.

keystring

The plaintext key: sk-mo-v1- followed by 64 hex characters. It appears in this one response and nowhere else, ever.

json
{
  "data": {
    "created_at": "2026-09-04T05:22:07.412Z",
    "updated_at": null,
    "hash": "4d6a8b2c0e1f3a5b7c9d0e2f4a6b8c0d1e3f5a7b9c1d3e5f7a9b1c3d5e7f9a1b",
    "label": "sk-mo-v1-8f2…c41",
    "name": "batch-worker",
    "disabled": false,
    "limit": 50000,
    "usage": 0
  },
  "key": "sk-mo-v1-8f2b6d1e0a4c7f93b5d8e02a6c1f4b7d9e3a5c8f0b2d4e6a8c0f2b4d6e8c41"
}

hash is precisely the SHA-256 of the returned key. You can check it yourself.

bash
printf '%s' "$PLAINTEXT_KEY" | sha256sum

Errors

Statuserror_typeWhen
400invalid_requestThe body is not valid JSON. name missing or empty. limit is not a number. limit_reset is not one of the four allowed values
401invalid_api_keyNo header. Called with an inference key. Unknown, switched-off, or revoked key
401expired_api_keyThe management key has expired
402insufficient_creditsThe management key is suspended_no_credit
403key_suspendedAn administrator suspended the management key
500serverAny other server-side failure
json
{
  "error": {
    "code": 400,
    "message": "`name` 이 필요합니다.",
    "metadata": { "error_type": "invalid_request" }
  }
}

message is written in Korean, the service's primary locale. Branch on metadata.error_type, not on the message text.

The three ways an issued key stops working

StatusSet byRequests getHow it is lifted
suspended_no_creditThe system, when the balance runs out402 insufficient_creditsAutomatically, on top-up
suspended_adminAn administrator403 key_suspendedOnly by an administrator
revokedDELETE /keys/{hash}401 invalid_api_keyNever. It is permanent

Separately, if a key has a limit and its period spend has reached it, requests get 402 key_limit_exceeded, with metadata.limit_krw and metadata.usage_krw attached.

最終更新 2026/09/05