Shader
First job from an agent

DocsStart5 of 35 · 2 min read

First job from an agent

Give a program an agent key and connect it over MCP, or let it pay one generation over x402 from its own wallet.

A program pays for Shader in one of two ways. With an agent key, it spends a wallet's credits inside caps the program enforces, and can rent GPUs as well as generate. With x402, it pays each generation in USDC from its own wallet, with no account and no key.

Agent keyx402
Who paysThe wallet that made the key, from its creditsThe agent's own wallet, per request
What it can buyRentals and generationsGenerations
LimitsPer-request and per-day caps on chainThe price of each request
How it callsThe MCP server, the CLI, the SDK or the API, with a bearer tokenThe four /x402/generate endpoints, or the SDK with a wallet signer
ReceiptsUnder the wallet, filtered by keyUnder the payer's wallet, kind x402

#With an agent key over MCP

  1. Make the key

    On Agents, create a key with a name and two caps in credits, sign, and copy the token. It is shown once. Create an agent key walks through it.

  2. Connect the client

    Add the server at https://api.shader.win/mcp to your MCP client with the token as a bearer token:

    {
      "mcpServers": {
        "shader": {
          "url": "https://api.shader.win/mcp",
          "headers": {
            "Authorization": "Bearer shdr_<YOUR_AGENT_TOKEN>"
          }
        }
      }
    }
  3. Work

    The agent calls get_balance, then rent_gpu or generate. Every charge settles on chain against the key. Use the MCP server lists the eight tools.

A coding agent can learn the CLI and the MCP server from the skill.

#With x402 from a bare wallet

  1. Fund a wallet

    Put USDC in a Solana wallet. It needs no SOL: Shader pays the transaction fee.

  2. Ask, pay, retry

    Call a generation endpoint, read the price from the 402 answer, and retry with a signed USDC transfer in PAYMENT-SIGNATURE. The 200 carries the job and its file.

Pay over x402 runs the whole exchange with a script, and the SDK does it in one call.