आपूर्तिकर्ता मशीन API

Supplier marketplace machine API: cabinet में sk-sup-… key mint करें, हर endpoint को Authorization: Bearer के साथ call करें, connections को batches में onboard करें और connections, offers, price changes, earnings तथा statistics पढ़ें।

Supplier cabinet की एक machine surface है: कोई supplier browser session के बजाय supplier-scoped API key का उपयोग करके script से accounts को bulk में onboard कर सकता है और अपने connections, offers, prices, price-change history, earnings और statistics पढ़ सकता है।

यह additive है। browser cabinet अपरिवर्तित रहता है, और machine routes वही payloads जोड़ते हैं जो cabinet pages जोड़ते हैं, इसलिए दोनों surfaces अलग-अलग numbers नहीं बता सकते।

key पाएँ

Machine keys supplier cabinet में बनाई और रद्द की जाती हैं। पूरा token केवल creation के समय एक बार दिखाया जाता है, और फिर कभी वापस नहीं लौटाया जाता।

  1. supplier cabinet खोलें और Machine API keys सेक्शन ढूँढें।
  2. key को एक label दें (optional) और create दबाएँ।
  3. token को तुरंत copy करें। यह sk-sup- से शुरू होता है।
  4. इसे किसी secret manager या environment variable में रखें। इसे कभी commit न करें और न ही support message में भेजें।
Keys hashed होती हैं, encrypt नहीं: ऑपरेटर सहित कोई भी खोई हुई key वापस नहीं पा सकता। उसे revoke करें और नई जारी करें। एक supplier अधिकतम 20 सक्रिय keys रख सकता है।

कैबिनेट प्रबंधन एंडपॉइंट

ये routes cabinet session या tracking token का उपयोग करते हैं। ये जानबूझकर machine key स्वीकार नहीं करते, इसलिए leak हुई machine key अन्य keys न तो बना सकती है और न ही revoke कर सकती है।

ParameterTypeविवरण
GET /api/marketplace/suppliers/me/api-keyslistList keys: id, label, prefix, active, lastUsedAt, createdAt. token या उसका hash कभी नहीं।
POST /api/marketplace/suppliers/me/api-keysmintBody { "label"?: string }। लौटाता है { "key": "sk-sup-…", "apiKey": { … } } — token केवल इसी समय दिखाई देता है।
DELETE /api/marketplace/suppliers/me/api-keys/{id}revokeएक key revoke करें। जब id caller का न हो तो 404।

Authentication

हर machine route के लिए supplier key bearer token के रूप में चाहिए:

Authorization: Bearer sk-sup-<64 hex>
curl https://getvibeapi.com/api/marketplace/suppliers/api/v1/connections \
  -H "Authorization: Bearer $SUPPLIER_API_KEY"

एक request key को ठीक एक supplier तक resolve करती है, और हर query उसी id से filter होती है। Revocation दोनों — key id और उसके owner — से scoped है, इसलिए कोई supplier दूसरे supplier की key revoke नहीं कर सकता। Key को कभी log या transmit न करें।

गुम, अज्ञात या revoked key एक ही तय 401 message लौटाती है, इसलिए caller इन मामलों में फ़र्क़ नहीं कर सकता। Key सिर्फ़ HTTPS पर भेजें।

पठन एंडपॉइंट्स

सभी GET हैं, API-key से authenticated और authenticated supplier तक scoped। Micro-USD money strings के रूप में लौटाया जाता है; token counts numbers होते हैं।

Connections

GEThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/connections

Supplier के जुड़े हुए accounts, प्रत्येक के साथ कि उसने क्या कमाया है (केवल payable)।

{
  "connections": [
    {
      "id": "…",
      "connectionType": "subscription-api-key",
      "subscriptionProductLabel": "…",
      "verifiedEndpoint": "https://…",
      "status": "ACTIVE",
      "enabled": true,
      "verificationState": "verified",
      "verifiedBy": "…",
      "label": "nightly-1",
      "account": "…",
      "verifiedModels": ["…"],
      "servingModels": ["…"],
      "lastVerifiedAt": "2026-09-18T09:00:00.000Z",
      "proxy": "…",
      "proxySource": "pool",
      "proxyCountry": "de",
      "proxyExpiresAt": "2026-10-18T09:00:00.000Z",
      "proxyExpiryDays": 30,
      "proxyLost": false,
      "probedVia": "…",
      "lastError": null,
      "needsReauth": false,
      "accountLimits": null,
      "accountLimitsSource": null,
      "accountLimitsCheckedAt": null,
      "earnings": { "earnedMicros": "1250000", "requestCount": 42 },
      "createdAt": "2026-09-01T09:00:00.000Z"
    }
  ]
}

ऑफ़र

GEThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/offers

Supplier के offers, वर्तमान कीमतों और official card के live percentage के साथ।

{
  "offers": [
    {
      "id": "…",
      "baseModel": "claude-opus-5",
      "claimedModel": "claude-opus-5",
      "providerLabel": "…",
      "status": "ACTIVE",
      "statusReason": null,
      "inputMicrosPer1M": "1000000",
      "outputMicrosPer1M": "2000000",
      "cacheReadMicrosPer1M": null,
      "blendedPctOfOfficial": "0.42",
      "officialPrice": null,
      "pctOfOfficial": 42,
      "trafficTier": "…",
      "cooldownUntil": null,
      "cooldownReason": null,
      "firstVerifiedAt": "2026-09-01T09:00:00.000Z",
      "activatedAt": "2026-09-01T09:00:00.000Z",
      "lastManualPriceChangeAt": null,
      "maxConcurrentRequests": 8,
      "servingEnabled": true
    }
  ]
}

मूल्य-परिवर्तन इतिहास

GEThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/offers/{offerId}/price-changes

किसी एक supplier के अपने offers के लिए price-change ledger: planned, applied और cancelled बदलाव। किसी दूसरे supplier से जुड़ा offer 404 जवाब देता है।

{
  "offerId": "…",
  "schedules": [
    {
      "id": "…",
      "offerId": "…",
      "priceInUsd": "1.000000",
      "priceOutUsd": "2.000000",
      "effectiveFrom": "2026-10-01T00:00:00.000Z",
      "createdAt": "2026-09-18T09:00:00.000Z",
      "cancelledAt": null,
      "appliedAt": null
    }
  ]
}

Statistics

GEThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/stats

वही आकार जो cabinet statistics page दिखाता है: totals, एक 14-दिन की daily series और प्रति-offer byOffer breakdown।

{
  "totals": {
    "requests": 12000,
    "successes": 11880,
    "errors": 90,
    "timeouts": 30,
    "successRatePct": 99,
    "promptTokens": 9000000,
    "completionTokens": 4000000,
    "cacheTokens": 2500000,
    "sourceCostMicros": 12345678,
    "avgLatencyMs": 812.4,
    "p50LatencyMs": 640,
    "p95LatencyMs": 2100
  },
  "daily": [
    { "date": "2026-09-05", "requests": 800, "successes": 795, "errors": 4, "promptTokens": 600000, "completionTokens": 250000, "sourceCostMicros": 900000 }
  ],
  "byOffer": [
    { "offerId": "…", "baseModel": "claude-opus-5", "requests": 12000, "successRatePct": 99, "promptTokens": 9000000, "completionTokens": 4000000, "tokens": 13000000, "sourceCostMicros": 12345678, "hitRate": 0.28, "effTotal": 3.14, "rank": 1 }
  ]
}

Earnings

GEThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/earnings

अधिकतम 500 recent settlement-eligible route attempts, newest first।

{
  "events": [
    {
      "id": "…",
      "baseModel": "claude-opus-5",
      "result": "SUCCESS",
      "promptTokens": "1200",
      "completionTokens": "800",
      "paidMicros": "420000",
      "settlementEligible": true,
      "finishedAt": "2026-09-18T09:00:00.000Z",
      "settlementStatus": "pending_or_settled"
    }
  ]
}

connections बनाएँ

POSThttps://getvibeapi.com/api/marketplace/suppliers/api/v1/connections

आपके पास पहले से मौजूद credential से एक account या पूरा pack बनाएँ — कोई browser OAuth round-trip नहीं। Body एक item, { "items": [ … ] } envelope, या bare array हो सकती है। तीनों को उसी per-item result में normalise किया जाता है। पुराना /api/marketplace/suppliers/api/v1/connections/batch path उसी handler का alias है।

credential के आकार

हर item provider से pool का नाम बताता है (readable pool name, जैसे codex या claude-code) और ठीक एक credential shape रखता है:

ParameterTypeविवरण
codexAuthJsoncodex-bundleCodex CLI ~/.codex/auth.json जैसा है वैसा ही paste किया गया: auth_mode, tokens.{id_token,access_token,refresh_token,account_id}, _meta.{plan_type,email}।
accessToken + refreshTokenclaude-tokensClaude Code access token (sk-ant-oat01-…) और उसका refresh token।
refreshTokenantigravity-refreshएक Antigravity refresh token।
apiKeyapi-keyएक तैयार subscription API key।
bindToken + oauthCodeoauth-codebrowser flow से OAuth result, जब आपने pasted bundle की जगह इसका इस्तेमाल किया।

हर item में एक काम करने वाला egress proxy होता है, और proxy-less connection जैसा कुछ नहीं है। अपना proxy दें, या हमारे में से किसी को prefer करने के लिए proxyCountry दें; दोनों में से कुछ न दें तो server किसी भी vendor request से पहले अपना एक proxy assign और prove करता है। यदि pool का कोई proxy prove नहीं हो पाता, तो item को proxy_unavailable के रूप में refuse कर दिया जाता है। correlation के लिए externalId ज्यों का त्यों echo किया जाता है।

curl https://getvibeapi.com/api/marketplace/suppliers/api/v1/connections \
  -H "Authorization: Bearer $SUPPLIER_API_KEY" \
  -H "Content-Type: application/json" \
  --data @pack.json

pack.json — एक अपना proxy और एक country-pool proxy:

[
  {
    "externalId": "codex-1",
    "provider": "codex",
    "connectionLabel": "nightly-codex-1",
    "codexAuthJson": "{\"auth_mode\":\"chatgpt\",\"tokens\":{\"id_token\":\"…\",\"access_token\":\"…\",\"refresh_token\":\"…\",\"account_id\":\"…\"},\"_meta\":{\"plan_type\":\"plus\",\"email\":\"…\"}}",
    "proxy": { "scheme": "http", "host": "proxy.example.com", "port": 8899, "username": "u", "password": "p" },
    "offers": [{ "baseModel": "deepseek-v4.1-flash", "inputMicrosPer1M": 1000000, "outputMicrosPer1M": 2000000 }]
  },
  {
    "externalId": "claude-1",
    "provider": "claude-code",
    "connectionLabel": "nightly-claude-1",
    "accessToken": "sk-ant-oat01-…",
    "refreshToken": "sk-ant-ort01-…",
    "proxyCountry": "de",
    "offers": [{ "baseModel": "claude-opus-5", "inputMicrosPer1M": 1000000, "outputMicrosPer1M": 2000000 }]
  }
]
एक ही account को दोबारा post करना सुरक्षित है: credential fingerprint अद्वितीय है, इसलिए retry एक per-item duplicate refusal लौटाता है और कुछ भी नया नहीं लिखता। विफल pack को item दर item retry करें।

Partial success ही contract है

हर item को vendor के सामने verify किया जाता है और अलग से लिखा जाता है। एक खराब row कभी पूरे batch को fail नहीं करती, और किसी item को ok: true तभी report किया जाता है जब उसकी connection row commit हो चुकी हो।

{
  "supplierId": "…",
  "accepted": 1,
  "rejected": 1,
  "results": [
    {
      "index": 0,
      "externalId": "row-1",
      "ok": true,
      "connectionId": "…",
      "connectionType": "subscription-api-key",
      "verificationState": "verified",
      "verifiedModels": ["…"],
      "subscriptionProduct": "codebuddy-cn",
      "verifiedEndpoint": "https://…",
      "latencyMs": 210
    },
    {
      "index": 1,
      "externalId": "row-2",
      "ok": false,
      "code": "bind_session_invalid",
      "error": "the authorization session expired or did not match"
    }
  ]
}

प्रति-आइटम अस्वीकृति कोड

ParameterTypeविवरण
invalid_credentialcodeVendor ने credential का shape या value अस्वीकार कर दिया।
connection_type_unavailablecodeवह connection type अभी उपलब्ध नहीं है।
subscription_product_unavailablecodeयह नामित subscription product उपलब्ध नहीं है।
provider_unavailablecodeचुना गया provider उपलब्ध नहीं है।
bind_session_invalidcodeOAuth session खत्म हो गया या match नहीं हुआ।
proxy_requiredcodeResolve किए गए proxy का कोई उपयोगी URL नहीं था। (जो item कोई proxy नहीं बताता, उसे इसके बजाय एक assign किया जाता है।)
proxy_unavailablecodeअनुरोधित देश के लिए, या कोई देश नामित न होने पर किसी भी देश के लिए, कोई pool proxy सिद्ध नहीं हो सका।
proxy_race_lostcodeवह proxy अभी-अभी किसी दूसरे connection ने ले लिया।
probe_failedcodeLive probe के दौरान vendor ने credential अस्वीकार कर दिया।
model_not_servedcodeअकाउंट ने माँगे गए model की पुष्टि नहीं की; अस्वीकार किए गए models item की "models" array में हैं।
duplicatecodeवही credential fingerprint पहले से जुड़ा हुआ है।
encryption_unavailablecodeproject पर credential encryption configure नहीं है।
internal_errorcodeएक unexpected server error। single item को बाद में retry करें।
किसी refusal में कभी भी credential, token या OAuth code शामिल नहीं होता। Refusals केवल item index और code के साथ log किए जाते हैं।

प्रॉक्सी प्री-फ़्लाइट

POSThttps://getvibeapi.com/api/marketplace/suppliers/proxy-check

किसी credential को सौंपने से पहले proxy को verify करें: अपना खुद का proxy या कोई proxyCountry दें और server वही tunnel खोलता है जिसका उपयोग वह connection के लिए करेगा और उसके ज़रिए एक neutral host तक पहुँचता है। यह केवल एक pre-flight है — create call वही जाँच चलाता है और token का आदान-प्रदान करने या vendor को probe करने से पहले मना कर देता है, इसलिए टूटा हुआ proxy कभी किसी credential की कीमत नहीं बनता।

curl https://getvibeapi.com/api/marketplace/suppliers/proxy-check \
  -H "Content-Type: application/json" \
  -d '{ "proxy": { "scheme": "http", "host": "proxy.example.com", "port": 8899, "username": "u", "password": "p" } }'
{ "ok": true, "outcome": "ok", "latencyMs": 42 }
Response में केवल एक outcome और एक latency होती है। यह कभी proxy URL, उसका userinfo या exit address नहीं दोहराता। विफलता 422 के साथ outcome: "proxy_failed" लौटाती है; जिस देश के लिए कोई free pool proxy नहीं है वह 409 के साथ proxy_unavailable लौटाता है।

ब्राउज़र OAuth (कैबिनेट)

cabinet का अपना two-step OAuth flow, उस स्थिति के लिए जब आप bundle रखने की जगह browser में account link करते हैं:

POSThttps://getvibeapi.com/api/marketplace/suppliers/connect/start

Body { "connectionType": "claude-code" | "codex-oauth" }। खोलने के लिए authorizeUrl और code को PKCE session से जोड़ने वाला signed bindToken लौटाता है। कुछ भी persist नहीं होता।

POSThttps://getvibeapi.com/api/marketplace/suppliers/connect

पूरा किया गया grant submit करता है — bindToken के साथ-साथ oauthCode और create item जैसे ही offers / proxy fields। code exchange होने से पहले proxy सिद्ध हो जाता है। ये दोनों routes cabinet session का उपयोग करते हैं; कोई machine key इन्हें call नहीं कर सकती (इसके बजाय bindToken + oauthCode के साथ POST /connections का उपयोग करें)।

दर सीमाएँ

ParameterTypeविवरण
Create connectionslimitप्रति call अधिकतम 25 items। प्रति supplier 20 calls प्रति घंटा, ऊपर से 120/hour per-IP cap के अतिरिक्त। हर item एक outbound vendor probe है।
Proxy pre-flightlimit30 calls per hour per IP। हर call एक neutral host के लिए एक tunnel खोलती है।
Read endpointslimitshared machine surface के लिए 600 requests per hour per IP, जब तक कोई route अपनी अलग cap तय न करे।
Cabinet key managementlimitkeys list करने के लिए 120/hour per IP, mint करने के लिए 20/hour, revoke करने के लिए 60/hour।
429 response में Retry-After सेकंड में आता है। उतनी देर back off करके retry करें; वही credential दोबारा submit करने पर unique credential fingerprint की वजह से duplicate के रूप में मना कर दिया जाता है।

त्रुटि प्रतिक्रियाएँ

ParameterTypeविवरण
401statusAPI key गुम, अज्ञात या निरस्त। एक ही निश्चित संदेश, ताकि caller इन स्थितियों में अंतर न कर सके।
404statusयह path इस project पर मौजूद नहीं है (यहाँ marketplace enabled नहीं है), या address किया गया offer किसी दूसरे supplier का है।
429statusRate limit। Retry-After shared limiter द्वारा लौटाया जाता है।
400statusMalformed JSON या cap से ऊपर का batch। body अमान्य input का नाम बताती है।

हर endpoint का machine-readable विवरण /api/openapi पर मौजूद OpenAPI document का हिस्सा है। typed client बनाने के लिए किसी OpenAPI client generator को उस पर point करें।

सप्लायर मशीन API — sk-sup keys, batch onboarding, reads | GetVibe API