본문으로 건너뛰기
API 레퍼런스
API 레퍼런스

API 키 가져오기

표준 API 키 하나와 현재 사용량 요약을 가져옵니다.

표준 API 키 하나와 현재 사용량 요약을 가져옵니다.

엔드포인트

GET /api/v1/keys/:id
Base URL
https://runapi.ai
API 버전
v1
인증
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
Authorization
계정 관리자 관리 API 키가 필요하며 해당 사용자가 소유한 키만 허용합니다.
02

요청

JSON 본문

나열된 요청 위치에만 값을 전송하세요.

경로 매개변수필드 1개
idstring
필수

API 키 접두사 ID(예: token_123).

03

성공 응답

HTTP 200

GET /api/v1/keys/:id

JSON
{
  "allowed_models": [
    "gpt-5.4"
  ],
  "created_at": "2026-07-27T10:00:00.000Z",
  "credit_limit_cents": 1000,
  "credit_limit_reset_interval": "daily",
  "credit_limit_windows": {
    "1d": {
      "limit_cents": 500
    },
    "1h": {
      "limit_cents": 100
    },
    "7d": {
      "limit_cents": 2000
    }
  },
  "credit_usage_cents_by_model": {
    "gpt-5.4": 250
  },
  "credit_usage_cents_this_month": 250,
  "credit_usage_cents_this_week": 100,
  "credit_usage_cents_today": 25,
  "credit_usage_cents_total": 250,
  "enabled": true,
  "guardrail_id": "guardrail_123",
  "id": "token_123",
  "last_used_at": null,
  "masked_token": "runapi_abc...wxyz",
  "name": "Production"
}
04

오류 응답 (401)

HTTP 401
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Authentication required"
}
05

오류 응답 (403)

HTTP 403
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Management API key required"
}
06

오류 응답 (403)

HTTP 403
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Account admin required"
}
07

오류 응답 (404)

HTTP 404
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Resource not found"
}
08

cURL 예시

CURL
curl -X GET https://runapi.ai/api/v1/keys/token_123 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY'