---
title: "OAuth2 Token Endpoint"
method: POST
path: "/oauth2/token"
tags: ["Authentication"]
---

# OAuth2 Token Endpoint

`POST /oauth2/token`

Obtain an OAuth2 access token using client credentials grant.
The client_id is the agent's DID and client_secret is obtained from oauth_credentials.json.

**Credentials location:** `.bindu/oauth_credentials.json`

**Grant type:** client_credentials

**Scopes:**
- openid: OpenID Connect scope
- offline: Offline access
- agent:read: Read agent data
- agent:write: Write agent data

## Response `200`

Access token granted

- OAuth2TokenResponse
  - `access_token` string, required — The OAuth2 access token (JWT)
  - `token_type` string, required — Token type (always "bearer")
  - `expires_in` integer, required — Token expiration time in seconds
  - `scope` string — Space-separated list of granted scopes

## Other responses

- `400` — Invalid request
- `401` — Invalid credentials

## Changes

- **2026-02-12** `970d68a5c55d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/getbindu/apis/bindu-agent-api/changes/oauth2/token/post.md)

---

[API](https://skmtc.dev/getbindu/apis/bindu-agent-api.md) · [All operations](https://skmtc.dev/getbindu/apis/bindu-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getbindu/bindu-agent-api/revisions/aec28fa7bf81/schema)
