Source: https://aiprimetech.io/de/docs/sdks/curl/ [Startseite](/de/) / [Dokumentation](/de/docs/) / cURL # cURL Beispiele ohne Abhängigkeiten für jeden Endpunkt — hilfreich für die Fehlersuche und CI-Prüfungen. Seite kopieren [ Als Markdown anzeigen](/de/docs/sdks/curl.md) [ ChatGPT fragen](https://chatgpt.com/?q=Read%20https%3A//aiprimetech.io/docs/sdks/curl.md%20and%20answer%20questions%20about%20it.%20Start%20with%20a%20short%20summary.) [ In Claude fragen](https://claude.ai/new?q=Read%20https%3A//aiprimetech.io/docs/sdks/curl.md%20and%20answer%20questions%20about%20it.%20Start%20with%20a%20short%20summary.) ## Modelle auflisten ``` Copycurl https://aiprimetech.io/v1/models \ -H "Authorization: Bearer $CLAUDEAPIKEY" ``` ## Messages ``` Copycurl https://aiprimetech.io/v1/messages \ -H "x-api-key: $CLAUDEAPIKEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "system": "Be concise.", "messages": [{"role": "user", "content": "What is a CDN?"}] }' ``` ## Chat Completions ``` Copycurl https://aiprimetech.io/v1/chat/completions \ -H "Authorization: Bearer $CLAUDEAPIKEY" \ -H "content-type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "messages": [ {"role": "system", "content": "Be concise."}, {"role": "user", "content": "What is a CDN?"} ] }' ``` ## Streaming ``` Copycurl -N https://aiprimetech.io/v1/messages \ -H "x-api-key: $CLAUDEAPIKEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model":"claude-sonnet-4-6","max_tokens":512,"stream":true, "messages":[{"role":"user","content":"Count to five"}]}' ``` -N deaktiviert die eigene Pufferung von curl. Ohne diese Option wird der gesamte Stream auf einmal angezeigt, sodass das Streaming fehlerhaft wirkt. ## Eine CI-Zustandsprüfung ``` Copy"c">#!/usr/bin/env bash set -euo pipefail code=$(curl -s -o /dev/null -w "%{http_code}" https://aiprimetech.io/v1/models \ -H "Authorization: Bearer $CLAUDEAPIKEY") [ "$code" = "200" ] || { echo "gateway check failed: $code" >&2; exit 1; } echo "gateway ok" ``` [FehlerDen Status interpretieren](/de/docs/api-reference/errors/)[FehlerbehebungWenn curl funktioniert, das SDK aber nicht](/de/docs/guides/troubleshooting/) [ZurückTypeScript](/de/docs/sdks/typescript/)[WeiterGo](/de/docs/sdks/go/)