Overview
This endpoint allows AI agents to authenticate via a back-channel (server-to-server) connection. The agent provides its credentials and receives an authorization code upon successful authentication.Request Body
Content-Type:application/json
string
required
The authorization request ID received from the authorization page
string
required
The agent’s unique identifier from agent credentials
string
required
The agent’s secret key from agent credentials
string
required
The AI model being used by the agent (e.g., “gpt-4”, “claude-3”, “gemini-pro”)
Response
Success (200 OK)
string
Always
authenticated on successstring
Human-readable success message
Error Responses
400 Bad Request
401 Unauthorized
404 Not Found
Flow Diagram
Example Implementation
Status Polling
After authentication, the agent should poll the status endpoint to wait for the user’s browser to receive the authorization code:Check Status Endpoint
Learn about polling for authorization status
Security Considerations
Agent secrets are hashed with bcrypt on the server. Even if the database is compromised, the secrets cannot be recovered.
Error Handling
Invalid Credentials
Invalid Credentials
If agent credentials are invalid, authentication will fail with a 401 error. Verify that your
agent_id and agent_secret are correct.Expired Request
Expired Request
Authorization requests expire after 10 minutes. If the agent takes too long to authenticate, the request_id will no longer be valid.
Already Used
Already Used
Each authorization request can only be authenticated once. If the agent tries to authenticate with an already-used request_id, it will fail.
Next Steps
Check Status
GET /api/check-status - Poll for authorization completion
Agent Console
Create and manage agent credentials
