Modell-Positivliste von Devin Desktop aktualisieren
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-Referenz
Modell-Positivliste von Devin Desktop aktualisieren
Ersetzen Sie die Modell-Positivliste von Devin Desktop für Ihr Team programmgesteuert: Legen Sie die erlaubten Modell-UIDs und Tags fest – mit einer ETag-Prüfung anhand des aktuellen Zustands.
PUT
/
api
/
v2alpha
/
models
Modell-Positivliste von Devin Desktop aktualisieren
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Übersicht
Ersetzt die Modell-Positivliste Ihres Teams – dieselbe Einstellung, die Administratoren in Devin Desktop unter den Organisationseinstellungen verwalten. Der Request-Body beschreibt den vollständigen Sollzustand: Die beiden Listen überschreiben die gespeicherten Listen. Damit Sie keine Änderung überschreiben, die Sie noch nicht gesehen haben, muss die Anfrage im HeaderIf-Match das ETag einer List Models-Antwort enthalten. Haben sich die Positivliste, die verfügbaren Modelle oder deren Preise seit dieser Antwort geändert, wird das Update mit 412 abgelehnt. Rufen Sie die Modelle in diesem Fall erneut ab.
Dieser Endpunkt befindet sich in der Alpha-Phase (
v2alpha). Die Struktur von Anfrage und Antwort kann sich noch ändern.Authentifizierung
Übergeben Sie einen API-Schlüssel imAuthorization-Header:
Authorization: Bearer <api-key>
cog_...). Zusätzlich zur Berechtigung Use Devin Desktop, die für List Models erforderlich ist, muss die Rolle des Dienstbenutzers die Berechtigung Windsurf admin (account.windsurf.admin) umfassen. Diese ist in der integrierten Rolle Account Admin enthalten. Ein Dienstbenutzer ohne diese Berechtigung kann zwar Modelle auflisten, erhält bei diesem Endpunkt jedoch den Fehler 403.
Anfrage
string
erforderlich
Der
ETag-Header einer GET /api/v2alpha/models-Antwort, der den aktuellen Zustand widerspiegelt. Erforderlich; * wird nicht akzeptiert.string[]
erforderlich
Modell-UIDs, die Nutzer auswählen dürfen, z. B.
["claude-sonnet-4-5"]. Übergeben Sie [], um Modelle ausschließlich über Tags zu erlauben.string[]
erforderlich
Modell-Tags, die Nutzer auswählen dürfen, einschließlich Anbieter-Tags wie
provider-anthropic oder provider-openai. Übergeben Sie [], um nur die aufgeführten Modell-UIDs zu erlauben.Beispielanfrage
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"]}'
Antwort
Bei Erfolg entspricht die Antwort der von List Models, jedoch mit angewendeter neuer Positivliste: jedes Modell mit seinemallowed-Flag, die gespeicherten allowed_model_uids und allowed_model_tags sowie ein neuer ETag-Header.
Fehlerantworten
Fehler werden als{"error": "<message>"} zurückgegeben.
| Status | Ursache |
|---|---|
400 | Der Body ist kein gültiges JSON, enthält unbekannte Felder oder es fehlt allowed_model_uids bzw. allowed_model_tags; oder der Query-Parameter filter ist gesetzt (dieser wird nur von List Models akzeptiert) |
401 | Fehlender oder ungültiger API-Schlüssel oder ein API-Schlüssel aus dem bisherigen Windsurf (akzeptiert werden nur Devin-Schlüssel für Dienstbenutzer im Format cog_...) |
403 | Der Nutzer des Schlüssels hat keinen Zugriff auf Devin Desktop oder seiner Rolle fehlt die Windsurf admin-Berechtigung (account.windsurf.admin) |
412 | If-Match stimmt nicht mit dem aktuellen ETag überein; rufen Sie die Liste der Modelle erneut ab und wiederholen Sie die Anfrage |
428 | If-Match-header fehlt |
429 | Anfragelimit überschritten; warten Sie die im Retry-After-header angegebene Zeit ab, bevor Sie die Anfrage wiederholen |

