{
  "info": {
    "name": "GME AI API",
    "description": "OpenAI-compatible AI gateway + Merchant (reseller) API for gme-ai.com.\n\nSet the collection variables first:\n- base_url : https://gme-ai.com\n- api_key  : your inference key (gme-...)\n- mgmt_key : your merchant management key (gmadm-...)\n\nInference requests use {{api_key}}; Merchant requests use {{mgmt_key}}. Full docs: https://gme-ai.com/docs",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://gme-ai.com", "type": "string" },
    { "key": "api_key", "value": "gme-YOUR_INFERENCE_KEY", "type": "string" },
    { "key": "mgmt_key", "value": "gmadm-YOUR_MANAGEMENT_KEY", "type": "string" }
  ],
  "item": [
    {
      "name": "Inference API",
      "description": "OpenAI-compatible. Authenticate with an inference key (gme-...).",
      "item": [
        {
          "name": "List models",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{api_key}}" } ],
            "url": { "raw": "{{base_url}}/v1/models", "host": [ "{{base_url}}" ], "path": [ "v1", "models" ] },
            "description": "Returns the models your key can call, in OpenAI list format."
          }
        },
        {
          "name": "Chat completion",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{api_key}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"model\": \"atg-gpt-5.4\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"Hello! Say hi in one short sentence.\" }\n  ]\n}" },
            "url": { "raw": "{{base_url}}/v1/chat/completions", "host": [ "{{base_url}}" ], "path": [ "v1", "chat", "completions" ] },
            "description": "A single chat completion. Add \"stream\": true for SSE."
          }
        },
        {
          "name": "Chat completion (streaming)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{api_key}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"model\": \"atg-gpt-5.4\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"Write one sentence about the sea.\" }\n  ],\n  \"stream\": true\n}" },
            "url": { "raw": "{{base_url}}/v1/chat/completions", "host": [ "{{base_url}}" ], "path": [ "v1", "chat", "completions" ] },
            "description": "Server-Sent Events stream of chat.completion.chunk objects, ending with data: [DONE]."
          }
        }
      ]
    },
    {
      "name": "Merchant API",
      "description": "Reseller management. Authenticate with a management key (gmadm-...). Cannot call /v1.",
      "item": [
        {
          "name": "Merchant info",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{mgmt_key}}" } ],
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/me", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "me" ] }
          }
        },
        {
          "name": "Create customer",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "signup-{{$guid}}" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"email\": \"dev@customer.com\",\n  \"display_name\": \"Dev\",\n  \"starting_balance_usd\": 10,\n  \"daily_cap_usd\": 5,\n  \"model_allowlist\": [\"atg-gpt-5.4\", \"atg-gpt-5.4-mini\"]\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/customers", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "customers" ] },
            "description": "Creates a customer, funds them from your pool, and mints their first inference key (shown once). Idempotency-Key prevents a retry from double-charging."
          }
        },
        {
          "name": "List customers",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{mgmt_key}}" } ],
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/customers", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "customers" ] }
          }
        },
        {
          "name": "List keys",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{mgmt_key}}" } ],
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/keys", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "keys" ] }
          }
        },
        {
          "name": "Mint key (existing customer)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"customer_id\": 341,\n  \"name\": \"prod key\",\n  \"daily_cap_usd\": 5\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/keys", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "keys" ] }
          }
        },
        {
          "name": "Update key",
          "request": {
            "method": "PATCH",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"daily_cap_usd\": 10,\n  \"rate_per_min\": 90\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/keys/88", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "keys", "88" ] }
          }
        },
        {
          "name": "Revoke key",
          "request": {
            "method": "POST",
            "header": [ { "key": "Authorization", "value": "Bearer {{mgmt_key}}" } ],
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/keys/88/revoke", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "keys", "88", "revoke" ] }
          }
        },
        {
          "name": "Rotate key",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"grace_hours\": 24\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/keys/88/rotate", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "keys", "88", "rotate" ] }
          }
        },
        {
          "name": "Top-up customer",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "topup-{{$guid}}" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"amount_usd\": 25\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/customers/341/topup", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "customers", "341", "topup" ] }
          }
        },
        {
          "name": "Claw back",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{mgmt_key}}" },
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "clawback-{{$guid}}" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"all\": true\n}" },
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/customers/341/clawback", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "customers", "341", "clawback" ] }
          }
        },
        {
          "name": "Usage report",
          "request": {
            "method": "GET",
            "header": [ { "key": "Authorization", "value": "Bearer {{mgmt_key}}" } ],
            "url": { "raw": "{{base_url}}/api/gme-ai/merchant/usage?days=28", "host": [ "{{base_url}}" ], "path": [ "api", "gme-ai", "merchant", "usage" ], "query": [ { "key": "days", "value": "28" }, { "key": "format", "value": "csv", "disabled": true } ] }
          }
        }
      ]
    }
  ]
}
