---
title: "创建 custom provider"
method: POST
path: "/provider/custom"
---

# 创建 custom provider

`POST /provider/custom`

Create a new custom AI provider configuration

## Query parameters

- `directory` string
- `workspace` string

## Request body

- object
  - `id` string, required
  - `npm` string, required
  - `name` string, required
  - `options` object
  - `models` object, required

## Response `200`

Provider created successfully

- object
  - `success` boolean, required

## Other responses

- `400` — Bad request
- `409` — Conflict

## Changes

- **2026-06-05** `8bb9a15bd144` — 1 info
  - added the non-success response with the status `409`
- **2026-04-25** `0a2d50cb4204` — 1 info
  - added the new optional `query` request parameter `workspace`
- **2026-01-19** `8814054514ee` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/provider/custom/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)
