Devin Desktop のモデルの許可リストを更新する
curl --request PUT \
--url https://server.codeium.com/api/v2alpha/models \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"allowed_model_uids": [
"<string>"
],
"allowed_model_tags": [
"<string>"
]
}
'import requests
url = "https://server.codeium.com/api/v2alpha/models"
payload = {
"allowed_model_uids": ["<string>"],
"allowed_model_tags": ["<string>"]
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allowed_model_uids: ['<string>'], allowed_model_tags: ['<string>']})
};
fetch('https://server.codeium.com/api/v2alpha/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v2alpha/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowed_model_uids' => [
'<string>'
],
'allowed_model_tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v2alpha/models"
payload := strings.NewReader("{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.codeium.com/api/v2alpha/models")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v2alpha/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAPI リファレンス
Devin Desktop のモデルの許可リストを更新する
Team の Devin Desktop のモデルの許可リストをプログラムで置き換えます。許可するモデル UID とタグを設定し、ETag を使って現在の状態との整合性をチェックします。
PUT
/
api
/
v2alpha
/
models
Devin Desktop のモデルの許可リストを更新する
curl --request PUT \
--url https://server.codeium.com/api/v2alpha/models \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"allowed_model_uids": [
"<string>"
],
"allowed_model_tags": [
"<string>"
]
}
'import requests
url = "https://server.codeium.com/api/v2alpha/models"
payload = {
"allowed_model_uids": ["<string>"],
"allowed_model_tags": ["<string>"]
}
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({allowed_model_uids: ['<string>'], allowed_model_tags: ['<string>']})
};
fetch('https://server.codeium.com/api/v2alpha/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v2alpha/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowed_model_uids' => [
'<string>'
],
'allowed_model_tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v2alpha/models"
payload := strings.NewReader("{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.codeium.com/api/v2alpha/models")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v2alpha/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowed_model_uids\": [\n \"<string>\"\n ],\n \"allowed_model_tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body概要
あなたの Team のモデルの許可リストを置き換えます。これは、管理者が Devin Desktop の組織のコントロールで管理する設定と同じものです。リクエストボディには、望ましい状態全体を指定します。2 つのリストは、保存済みのリストを上書きします。 まだ確認していない変更を誤って上書きしないよう、リクエストのIf-Match には、List Models のレスポンスで取得した ETag を指定する必要があります。そのレスポンス以降に許可リスト、利用可能なモデル、またはその料金が変更されている場合、更新は 412 で拒否されます。その場合は、モデル一覧を再取得してください。
このエンドポイントはアルファ版 (
v2alpha) です。リクエストおよびレスポンスの形式は変更される可能性があります。認証
Authorization ヘッダーに APIキーを指定します:
Authorization: Bearer <api-key>
cog_...) を利用してください。List Models に必要な Use Devin Desktop 権限に加えて、サービスユーザーのロールには Windsurf 管理者 権限 (account.windsurf.admin) も必要です。この権限は built-in の Account Admin ロールに含まれています。この権限がないサービスユーザーは、モデルの一覧は取得できますが、このエンドポイントでは 403 が返されます。
リクエスト
string
必須
現在の状態を反映した
GET /api/v2alpha/models レスポンスの ETag ヘッダー。必須です。* は使用できません。string[]
必須
ユーザーが選択できるモデルの UID (例:
["claude-sonnet-4-5"]) 。タグのみでモデルを許可する場合は [] を渡します。string[]
必須
ユーザーが選択できるモデルのタグ。
provider-anthropic や provider-openai などのプロバイダータグも指定できます。指定したモデル UID のみを許可する場合は [] を渡します。リクエスト例
ETAG=$(curl -s -D - -o /dev/null https://server.codeium.com/api/v2alpha/models \
-H "Authorization: Bearer $DEVIN_API_KEY" | awk 'tolower($1)=="etag:" {print $2}' | tr -d '\r')
curl -X PUT https://server.codeium.com/api/v2alpha/models \
-H "Authorization: Bearer $DEVIN_API_KEY" \
-H "If-Match: $ETAG" \
-H "Content-Type: application/json" \
-d '{"allowed_model_uids": ["claude-sonnet-4-5"], "allowed_model_tags": ["provider-anthropic"]}'
レスポンス
成功した場合、レスポンスは List Models と同じ形式で、新しい許可リストが適用された内容になります。具体的には、allowed flag を含むすべてのモデル、保存済みの allowed_model_uids と allowed_model_tags、および新しい ETag ヘッダーが返されます。
エラーレスポンス
エラーは{"error": "<message>"} の形式で返されます。
| ステータス | 原因 |
|---|---|
400 | ボディが JSON ではない、未定義のフィールドが含まれている、または allowed_model_uids か allowed_model_tags が指定されていない。あるいは filter クエリパラメーターが指定されている (このパラメーターを受け付けるのは List Models のみです) |
401 | APIキーが指定されていないか無効である、またはレガシー Windsurf のAPIキーが使用されている (受け付けられるのは Devin の cog_... サービスユーザーキーのみ) |
403 | キーに紐づくユーザーに Devin Desktop へのアクセス権がない、またはそのロールに Windsurf 管理者権限 (account.windsurf.admin) がない |
412 | If-Match が現在の ETag と一致しない。モデル一覧を再取得してからリトライしてください |
428 | If-Match ヘッダーが指定されていない |
429 | レート制限超過。Retry-After ヘッダーで示された時間が経過するまで待ってからリトライしてください |

