Skip to main content
POST
Start MCP OAuth authorization

Headers

kimi-api-version
enum<string>

API version for this request, in YYYY-MM-DD form. Send 2026-09-01-beta for the version documented here. Required outside /v1/files*: a missing header there is rejected with 400 invalid_request_error; on /v1/files* its absence selects the compatibility behavior. An unknown value is rejected with 400 invalid_request_error on every endpoint. API versions served by the platform. New dated versions are added as they ship; a version is removed after its announced Sunset date.

Available options:
2026-09-01-beta

Path Parameters

id
string
required

Vault ID.

Body

application/json

MCP server URL and optional OAuth client settings for authorization.

Request body for starting an MCP OAuth authorization flow.

mcp_server_url
string
required

MCP server URL to authorize.

Required string length: 1 - 2048
Example:

"https://example.invalid/mcp"

display_name
string

Display name for the credential created after authorization. Falls back to the server URL.

Maximum string length: 128
Example:

"MCP access"

client
object

OAuth client to use. If omitted, a client is registered automatically with the authorization server (dynamic client registration).

Example:
egress_environment_id
string

Optional Environment bound on the credential created after authorization completes; same semantics as MCPOAuthCredential.egress_environment_id.

Maximum string length: 64
Example:

"env_01h455vb4pex5vsknk084sn02q"

Response

The OAuth session ID and the authorize_url to open.

Details needed to continue an MCP OAuth authorization flow.

oauth_session_id
string
required

OAuth session ID used to poll the authorization status.

Example:

"voss_01h455vb4pex5vsknk084sn02q"

authorize_url
string
required

Authorization URL to open in a browser window. The flow uses PKCE S256.

Example:

"https://example.invalid/authorize"

mcp_server_url
string
required

Normalized MCP server URL used to identify the credential after authorization.

Example:

"https://example.invalid/mcp"