---
title: "OAuth authorize"
method: POST
path: "/provider/{providerID}/oauth/authorize"
---

# OAuth authorize

`POST /provider/{providerID}/oauth/authorize`

Initiate OAuth authorization for a specific AI provider to get an authorization URL.

## Path parameters

- `providerID` string, required

## Query parameters

- `directory` string
- `workspace` string

## Request body

- object
  - `method` number, required — Auth method index
  - `inputs` object — Prompt inputs

## Response `200`

Authorization URL and method

- ProviderAuthAuthorization
  - `url` string, required
  - `method` 'auto' | 'code', required
  - `instructions` string, required

## Other responses

- `400` — Bad request

## Changes

- **2026-05-06** `067d03067fb2` — 1 breaking, 2 warning, 1 info
  - the `method` response's property type changed from no type to `string` for status `200`
  - added the new `auto` enum value to the `method` response property for the response status `200`
  - added the new `code` enum value to the `method` response property for the response status `200`
  - removed `subschema #1, subschema #2` from the `method` response property `anyOf` list for the response status `200`
- **2026-04-25** `0a2d50cb4204` — 2 info
  - added the new optional `query` request parameter `workspace`
  - added the new optional request property `inputs`
- **2025-12-16** `dc065d96c390` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/provider/:providerID/oauth/authorize/post.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) · [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kaaass/opencode/revisions/8bb9a15bd144/schema)
