Run a completion via the gateway (validator auth)
Authenticated by a Bittensor validator's sr25519 signature over the newline-joined canonical message `sub41-gateway-v1\nMETHOD\npathAndQuery\nminerHotkey\nnonce\ntimestamp\nsha256(body) hex`. The body hash covers the request body exactly as sent on the wire (raw bytes) — send precisely the bytes you hashed; the server never re-serializes. The billed org is resolved from `x-miner-hotkey` via `OrgMiner` / `SubnetRegistration`. Replayed nonces and stale metagraph reads fail closed.
/v1/gateway/validator/completionsAuthorization
validator-auth Bittensor validator sr25519 signature. Also send x-validator-hotkey, x-validator-nonce, x-validator-timestamp (and x-miner-hotkey on the gateway proxy route).
In: header
Header Parameters
Optional client-chosen key (1–255 chars), scoped to the billed org. A repeat request with a key that already produced a successful completion is rejected with 409 and no provider call or debit occurs. Failed calls do not consume the key. Note: this header is not part of the signed canonical message.
SS58 hotkey of the miner whose org should be billed. Must be registered via POST /miners.
Unix epoch milliseconds. Rejected outside the configured clock-skew window.
16–128 char nonce. Single-use per validator within the TTL window.
Hex-encoded sr25519 signature over the canonical message.
SS58 hotkey of the signing validator (must hold a validator permit in the synced metagraph).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/gateway/validator/completions" \ -H "x-miner-hotkey: string" \ -H "x-validator-timestamp: string" \ -H "x-validator-nonce: string" \ -H "x-validator-signature: string" \ -H "x-validator-hotkey: string" \ -H "Content-Type: application/json" \ -d '{ "provider": "openrouter", "model": "anthropic/claude-3.5-sonnet", "messages": [ { "role": "system", "content": "Hello!" } ] }'{ "provider": "openrouter", "model": "anthropic/claude-3.5-sonnet", "output": "The market is likely to resolve YES because…", "usage": { "promptTokens": 412, "completionTokens": 187, "totalTokens": 599, "cacheReadInputTokens": 2048, "cacheCreationInputTokens": 0, "costUsd": 0.00342 }, "costMicro": "12500", "providerCostMicro": "10000", "markupBps": 2500, "balanceAfterMicro": "987500"}Run a completion via the gateway (API-key auth) POST
Proxies to the requested upstream provider (`openrouter`, `anthropic`, `engy`). Charges the caller's org for `provider cost × (1 + markup)` after a successful upstream response. Miner attribution resolves in order: `minerHotkey` in payload → API key's pinned miner → org's default miner → none.
List supported gateway providers and models GET
Public catalog of gateway providers that are registered and have at least one actively priced model. Does not include pricing or markup.