The Cargo auth docs explain how to obtain the one credential that unlocks the REST API, the CLI, Cargo projects, the agent skills, and MCP.
There is one credential. Sign in once; nothing else needs configuring.
npm install -g @cargo-ai/cli
cargo-ai login --email you@company.com
A new account gets 100 free credits for its first month, with no card. --email mails a one-time code and creates the account and a workspace on first use.
Methods
| You are | Use | Browser |
|---|---|---|
| An agent, a sandbox, CI, any shell | cargo-ai login --email you@company.com | no |
| An agent signing in as its own AgentID | cargo-ai login --agentid | the AgentID page, not the Cargo app |
| A person at a workstation | cargo-ai login --oauth | yes |
| CI with a token already issued | cargo-ai login --token <token> or CARGO_API_TOKEN | no |
In an agent or sandbox shell with no terminal to prompt at, the first --email call sends the code and exits. Re-run it with --code.
cargo-ai login --agentid is the path for an agent that should sign in as its own AgentMail inbox rather than as a person’s address. The command prints an Auth0 URL and waits for the redirect. Open that URL once. A second visit starts a different sign-in. It does not open the Cargo app. When AgentID shows an auth token, approve it within 5 minutes with agentmail inboxes authorize --inbox-id <inbox> --auth-token <token> --accept-disclosure true.
Calling the API
curl https://api.getcargo.io/v1/storage/models/list \
-H "Authorization: Bearer $CARGO_API_TOKEN"
OAuth
Authorization-server metadata (RFC 8414) is at https://auth.getcargo.io/.well-known/oauth-authorization-server. Device code, authorization code with PKCE (S256), registration, and revocation are advertised there.
The product MCP server at https://mcp.getcargo.io challenges with OAuth and publishes protected-resource metadata. See Cargo MCP server.
Machine-readable walkthrough
The step-by-step agent walkthrough — Discover, Pick a method, Register, Claim, Use, Revocation — is https://www.getcargo.ai/auth.md. Fetch that file when you need the WorkOS auth.md shape rather than this summary.
Related
- Cargo API docs
- Cargo OpenAPI spec
- Versioning and deprecation: https://docs.getcargo.ai/api-reference/versioning