Authenticate an unattended agent
Use a credential already available to your workspace to authenticate without a browser. For an SDK integration or a REST API request, use a project API key.
Agent signup is unavailable
If you have no credential, pause live verification and ask a human to set one up.
Install and log in
Install the Composio CLI, then make it available in the current shell:
curl -fsSL https://composio.dev/install | sh
export PATH="$HOME/.local/bin:$PATH"For CLI commands, reuse a saved login or have your secret manager supply an existing user API key as COMPOSIO_USER_API_KEY. Run composio whoami to check which account the CLI uses.
If you have a saved READY agent identity, running composio login in a non-interactive terminal can reuse it.
Configure the application API key
Supply an existing project API key as COMPOSIO_API_KEY through your workspace or deployment secret manager. For local development, you can also use the ignored .env or .env.local file that your application loads.
If a previous agent signup saved a project key, it is the composio.api_key field in ~/.composio/agent.json or in agent.json under COMPOSIO_CACHE_DIR.
Start your application with COMPOSIO_API_KEY set. The SDK reads it from the environment. For REST calls, send it in the x-api-key header. Keep the key out of chat, version control, browser bundles, and logs.
Verify a live tool call
First, verify the project key against a tool that needs no connected account. This example reads the public Hacker News profile for pg. In the shell where you exported COMPOSIO_API_KEY, run:
from composio import Composio
composio = Composio()
result = composio.client.post(
"/api/v3.1/tools/execute/HACKERNEWS_GET_USER",
cast_to=object,
body={"arguments": {"username": "pg"}},
)
print(result)Check both the HTTP result and the response body. Require successful: true, no tool error, and profile data for the requested username. An HTTP 401, a tool schema lookup, or a successful build does not prove tool execution. A local mock verifies only the local code path.
Then run the integration's own script or API route with the same project key and the intended application user ID. If the requested action needs an app account, complete its connection flow first. OAuth consent, app permissions, and provider credentials still apply.
For an authorized write action, verify the resulting object or state through a follow-up read or the provider's UI. Record the tool slug, sanitized result, and returned log ID if present. If only the Hacker News check succeeds, report that check separately from the requested integration action. If app authorization is unavailable, report the remaining connection step and leave the action unverified.
Hand credential setup to a human
For SDK or API access, ask someone with access to the intended project to supply a project API key through your workspace's secret configuration. For CLI access, ask a human to run composio login in the workspace or complete the browser login below.
Log in with a human
When a human is available but your terminal cannot open a browser, print a login URL:
composio login --no-waitShare the URL with the human so they can sign in to their account, then complete login. Bound the poll so it returns before your turn ends:
composio login --poll --timeout 120--timeout takes seconds, from 1 to 600. A poll that runs out exits non-zero, prints the login URL again, and says to run the same command again once the human has clicked. The pending login expires after ten minutes; run composio login --no-wait again if it expires. For a human account, obtain a project API key from the dashboard.