Client Credentials
The simplest way to authenticate — exchange aclient_id and client_secret for an access token.
When to Use
- Server-to-server communication
- AI agent authentication
- Background services
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Authenticate your agent or server using client credentials.
client_id and client_secret for an access token.
POST /oauth/token
Content-Type: application/json
{
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600
}
import { BKeyClient } from '@bkey/sdk';
const bkey = new BKeyClient({
clientId: process.env.BKEY_CLIENT_ID!,
clientSecret: process.env.BKEY_CLIENT_SECRET!,
});
// Token is automatically obtained and refreshed
from bkey import BKeyClient
client = BKeyClient(
client_id="your-client-id",
client_secret="your-client-secret",
)
# Token is automatically obtained and refreshed