Shared Req client factories for RunPod's three APIs:
- REST management —
https://rest.runpod.io/v1— pods, endpoints, templates, network volumes, container registry auth, billing. - Serverless runtime —
https://api.runpod.ai/v2/<endpoint>— job submission, status polling, streaming. - Legacy GraphQL —
https://api.runpod.io/graphql— GPU pricing catalog (not exposed in REST).
Each factory returns a Req.Request.t() pre-configured with authentication,
JSON codec, retry policy, and telemetry. Consumers compose further via
Req.merge/2 or pass extra options per call.
Summary
Functions
Build a Req client for the legacy GraphQL API.
GraphQL endpoint URL.
Normalize a Req result into {:ok, body} | {:error, ExAtlas.Error.t()}.
Build a Req client for the REST management API.
Base URL for the REST management API.
Build a Req client for the serverless runtime API, scoped to an endpoint id.
Base URL for the serverless runtime API.
Functions
@spec graphql(ExAtlas.Provider.ctx()) :: Req.Request.t()
Build a Req client for the legacy GraphQL API.
GraphQL uses ?api_key= as a query param, not a header.
GraphQL endpoint URL.
@spec handle_response( {:ok, Req.Response.t()} | {:error, term()}, integer() | Range.t() ) :: {:ok, term()} | {:error, ExAtlas.Error.t()}
Normalize a Req result into {:ok, body} | {:error, ExAtlas.Error.t()}.
Accepts the {:ok, %Req.Response{}} | {:error, exception} returned by Req.
@spec management(ExAtlas.Provider.ctx()) :: Req.Request.t()
Build a Req client for the REST management API.
Uses Authorization: Bearer <key>. Applies :retry :transient and a 30s
receive timeout. Extra options in ctx.req_options are merged in last and
win.
Base URL for the REST management API.
@spec runtime(ExAtlas.Provider.ctx(), String.t()) :: Req.Request.t()
Build a Req client for the serverless runtime API, scoped to an endpoint id.
Example: runtime(ctx, "abc123") talks to https://api.runpod.ai/v2/abc123.
Base URL for the serverless runtime API.