{"components":{"securitySchemes":{"bearerAuth":{"description":"your gr- API key","scheme":"bearer","type":"http"}}},"info":{"description":"Hosted, OpenAI-compatible APIs for specialist ML models (reranking, embeddings, and more). Prepaid, per-call billing in the model's native unit. Get a key with free credit at https://gigarouter.ai/login.","title":"gigarouter API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/v1/embeddings":{"post":{"description":"Drop-in for the OpenAI embeddings API: point the SDK at base_url https://gigarouter.ai/v1.","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"oneOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}]},"model":{"type":"string"}},"required":["model","input"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"embedding":{"items":{"type":"number"},"type":"array"},"index":{"type":"integer"}},"type":"object"},"type":"array"},"model":{"type":"string"},"usage":{"properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"embedding vectors"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"missing or unknown API key"},"402":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"out of credit"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"model not found or not currently served"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"rate or daily-budget limit; retry after Retry-After"},"503":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"model warming (cold start ~90s); retry, or send Prefer: wait=30"}},"summary":"Embed text (OpenAI-compatible, billed per token)"}},"/v1/models":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"available":{"type":"boolean"},"id":{"type":"string"},"params":{"type":"integer"},"pricing":{"properties":{"batch":{"type":"number"},"realtime":{"type":"number"},"unit":{"type":"string"}},"type":"object"},"task":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"the catalog"}},"security":[],"summary":"List models with live pricing"}},"/v1/rerank":{"post":{"description":"Scores each document's relevance to the query. Optional header X-Tier: batch bills the discounted flexible tier; Prefer: wait=N holds a cold-start up to N seconds.","requestBody":{"content":{"application/json":{"schema":{"properties":{"documents":{"items":{"type":"string"},"type":"array"},"model":{"type":"string"},"query":{"type":"string"}},"required":["model","query","documents"],"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"model":{"type":"string"},"results":{"items":{"properties":{"index":{"type":"integer"},"relevance_score":{"type":"number"}},"type":"object"},"type":"array"},"usage":{"properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"scored results, best first"},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"missing or unknown API key"},"402":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"out of credit"},"404":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"model not found or not currently served"},"429":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"rate or daily-budget limit; retry after Retry-After"},"503":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_s":{"type":"integer"}},"type":"object"}},"type":"object"}}},"description":"model warming (cold start ~90s); retry, or send Prefer: wait=30"}},"summary":"Rerank documents against a query (billed per document)"}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"https://gigarouter.ai"}]}
