Skip to content

Start as an agent

There are several independent ways in. Pick the one that fits; none replaces another.

Choose a way in

  • Just trying it, no key: POST /api/public/compute/demo, or MCP at /api/mcp/rpc without a key. A demo tenant, rate limited per IP.
  • An MCP client a person uses, such as Claude: Add https://api.last-price.ai/api/mcp. The open tools work with no sign-in; the first tool that needs an account asks the person to sign in. Sign in from an MCP client
  • A free API key right now, no human: POST /api/agents/register. A sandbox workspace with 25 compute calls a day and a key valid for 30 days, plus a claim link for a person.
  • An OAuth client for a client-credentials framework: POST /api/oauth/register (dynamic client registration), then the client_credentials grant at POST /api/oauth/token. For a person signing in, see the MCP client section below. The same sandbox as the call above; an additional option, not a replacement.
  • No account, pay per call: Where pay-per-call is on, POST /api/compute/price with no credential answers 402 with x402 payment requirements. agents.json lists it under payments.x402 only while it is on. Give your agent a wallet
  • A full workspace of your own, no person and no browser: Register, top up the workspace with at least 10 USDC over x402 at POST /api/billing/topup, then POST /api/agents/upgrade with the same key. The limits lift for good and the key stops expiring. Lift the sandbox yourself
  • A workspace of your own, as an agent: Sign in with AgentID and an inbox you control, then create an API key in Settings.
  • A person owns the account: A person signs up and creates an API key, or an agent-bound key, for the agent.

Register with one call

No account, inbox or person is needed. Send your name and you get a sandbox workspace and an API key straight away.

curl -X POST https://api.last-price.ai/api/agents/register \
  -H 'content-type: application/json' \
  -d '{"name":"your-system/role-name"}'

On Windows, if curl fails: curl.exe and PowerShell (Invoke-RestMethod, Invoke-WebRequest) use the Windows TLS stack. Inside a sandbox, such as the one Codex runs commands in, it can fail before connecting with SEC_E_NO_CREDENTIALS (0x8009030E) or "Authentication failed, see inner exception". That is local to the sandbox, and --ssl-no-revoke does not fix it: make the same call with Node (fetch) or Python, which bring their own TLS, or use the MCP server. If curl instead reports CRYPT_E_REVOCATION_OFFLINE or CRYPT_E_NO_REVOCATION_CHECK (a network that blocks certificate revocation checks), add --ssl-no-revoke.

node -e "fetch('https://api.last-price.ai/api/agents/register',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({name:'your-system/role-name'})}).then(r=>r.text()).then(console.log)"

The response shows the key once in api_key.key. Send it as the x-api-key header. It can compute prices with built-in functions and read functions and routing policies, up to 25 compute calls a day, and it expires after 30 days. It can rotate itself at /api/api-keys/rotate, and it also works as OAuth client credentials at /api/oauth/token. If your OAuth client-credentials framework expects to register its own client, POST /api/oauth/register gives the same sandbox as a client_id and client_secret instead. Its metadata lives at https://api.last-price.ai/.well-known/oauth-authorization-server: scopes_supported lists every scope a token can carry, and self_registration_scopes the ones a self-registered client gets until its workspace is claimed.

The response also carries a claim link. Give it to a person: when they sign in and claim the workspace, it joins their account and the sandbox limits lift.

Lift the sandbox yourself

No person is needed to lift the sandbox. Paying is the proof a person's claim used to give.

  1. Top up the workspace with at least 10 USDC: POST /api/billing/topup with {"amount":"10"} and your key answers 402 with the payment requirements; send it again with a signed x402 payment. The money stays the workspace's compute balance.
  2. POST /api/agents/upgrade with the same key. The daily limit and the claimed_workspace refusals are gone for good, the key stops expiring and holds every scope, and the workspace stays yours: no person is added. GET /api/agents/upgrade shows how far you are before you start.
  3. Need helpers? With the same key, POST /api/agents with {"name":"your-system/helper","scopes":["price:compute"]}, then POST /api/agents/<helper id>/keys for its key. Your agent is the owner here, so it manages the workspace's agents itself. It cannot revoke or pause itself.
  4. Mail goes out from the inbox Last Price made for your agent: POST /api/agents/<your agent id>/inbox with {"to":["..."],"subject":"...","text":"..."} and the same key. Up to 10 recipients a message and 20 messages an hour.
  5. Lost the key later? GET /api/agents/recover?workspace_id=<id>&address=<the wallet that paid> returns a message. Sign it with EIP-191 personal_sign within five minutes and POST /api/agents/recover with {"message":"...","signature":"0x..."}: every old key is revoked and a new one is returned once.

A person can still claim an upgraded workspace with its claim link later. That is optional.

Or sign in with AgentID

  1. Bring an inbox you control

    Create an inbox through your AgentMail account and keep its API key private. AgentID sign-in requires provider_connect permission on that key.

    AgentID is an interactive sign-in, not open dynamic client registration. You authorize the pending sign-in with your own AgentMail inbox API key, sent as the Bearer to the inbox provider.

    AgentMail sign-in instructions

  2. Sign in to Last Price

    Open signup and choose Sign in with AgentID when the option is available. On auth.agentid.com, verify the application is Last Price Project and review the requested agent name and email. Authorize the pending sign-in with your own inbox through api.agentmail.to. Never send your AgentMail key to Last Price.

    Verified accounts start right away. During a surge of sign-ups the Last Price team may switch on a waitlist for a while; a new account then waits for approval, and agents.json reports approval_required: true. Suspended and rejected accounts remain restricted.

  3. Use your workspace

    Continue to onboarding after the sign-in callback. Your browser session grants access to your workspace, not staff administration. Choose a workflow or open the dashboard.

  4. Create an API credential

    Open Settings, API keys, and create a key with only the scopes your task needs. Send it as the x-api-key header. Call GET /api/me to discover the workspace it resolves to; consult the API contract before making pricing calls. A browser sign-in session is not an API key.

    To compute prices, the key needs the price:compute scope. Pick it in the Settings API key dialog. A legacy write or admin key still authenticates GET /api/me, but compute answers 403 insufficient_scope. Create a new key with price:compute instead.

Needs a claimed workspace

Rosetta, UCP checkout and quotes, the commerce control plane, usage reads and outcomes, and receipts need a claimed workspace: a self-registered sandbox key gets 403 sandbox_restricted (requires: claimed_workspace) on each of them until a person claims the workspace.

The refusal says requires: claimed_workspace and carries the claim step in next. The claim must send keep_agent_key: true for the same key to keep working afterwards; without it the claim revokes the agent and its key.

  • Rosetta schema translation
  • UCP checkout sessions and quotes
  • Commerce control plane
  • Usage reads and outcomes
  • Receipts

Sign in from an MCP client

Add https://api.last-price.ai/api/mcp as a custom connector in Claude, or as a remote server in any MCP client that supports OAuth. Nothing is asked up front: pricing, the catalog, the marketplace and offers work with no account. The first time a tool needs one, the server answers 401 and the client opens Last Price for the person to sign in.

  1. The person signs in, or creates an account, and sees which app is asking and where it will send them back.
  2. They choose a workspace and either everything they can do there, or read only, then Allow.
  3. The client gets a one-hour access token and a refresh token, and retries the call. The app works as that person, with their role in that workspace.

Disconnect an app any time in Profile, Sessions, Connected apps. Clients find everything from /.well-known/oauth-protected-resource/api/mcp: authorization code with PKCE (S256), dynamic client registration at POST /api/oauth/register, client ID metadata documents, refresh token rotation and revocation at POST /api/oauth/revoke. API keys keep working at /api/mcp/rpc.

Before you compute: check the scope

GET /api/me answers for any valid key, including a read, write or admin key, so a 200 there does not mean the key can compute. Compute needs the price:compute scope. GET /api/me lists the key's scopes: check for price:compute before your first POST /api/compute/price, because a key without it answers 403 insufficient_scope.

Creating an agent and its key yourself needs a person: POST /api/agents takes a person's credential, so a Supabase session is first exchanged at POST /api/auth/native-token, then the agent and key calls follow, as the next section shows.

Mint an agent key from a session

Creating an agent and its key needs a person's credential: a dashboard session or a JWT not bound to an agent. An API key cannot do it, and gets 403 wrong_auth_modality. A JWT bound to an agent gets 403. If you hold a Supabase session but no API key yet, make three calls:

  1. POST /api/auth/native-token: Send the Supabase access token as Authorization: Bearer. It returns a Last Price JWT in access_token, valid for one hour.
  2. POST /api/agents: Send that JWT as Authorization: Bearer, with a body such as {"name":"your-system/role-name","scopes":["price:compute"]}. The agent id is in data.agent.id.
  3. POST /api/agents/{id}/keys: With the same JWT, send {"name":"compute","scopes":["price:compute"]}. The response shows the key once in data.api_key.key. Send it as the x-api-key header.

Email and Google sign-in remain available. For help, email support@last-price.ai.