Modelle auflisten (Anthropic-Format)
Listet jedes Textmodell auf, das der API-Key verwenden darf — im Modell-Listen-Format von Anthropic, damit Anthropic-SDK-Clients Modelle aufzählen können. id ist der Registry-Modellname, der als model an /anthropic/v1/messages übergeben wird.
GET
https://api.deutschlandgpt.de/anthropic/v1/modelsBeispielaufruf
curl https://api.deutschlandgpt.de/anthropic/v1/models \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"curl https://api.deutschlandgpt.de/anthropic/v1/models \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/anthropic/v1/models",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/anthropic/v1/models",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())const response = await fetch('https://api.deutschlandgpt.de/anthropic/v1/models', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());const response = await fetch('https://api.deutschlandgpt.de/anthropic/v1/models', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());Antwort
200application/json
{
"data": [
{
"type": "model",
"id": "claude-4.5-sonnet",
"display_name": "string",
"created_at": "2025-01-01T00:00:00Z"
}
],
"has_more": true,
"first_id": "string",
"last_id": "string"
}{
"data": [
{
"type": "model",
"id": "claude-4.5-sonnet",
"display_name": "string",
"created_at": "2025-01-01T00:00:00Z"
}
],
"has_more": true,
"first_id": "string",
"last_id": "string"
}Die für diesen API-Key verfügbaren Modelle.
dataAnthropicModel[]erforderlichtypestringerforderlichidstringerforderlichRegistry-Modellname — als model an /anthropic/v1/messages übergeben.
display_namestringerforderlichcreated_atstring<date-time>erforderlichhas_morebooleanerforderlichfirst_idstring | nullerforderlichlast_idstring | nullerforderlichStatuscodes
200
Die für diesen API-Key verfügbaren Modelle.
object401
Fehlender oder ungültiger API-Key.
AnthropicErrorWar diese Seite hilfreich?