curl
The whole API is plain HTTP and JSON. No SDK required.
Chat completion
curl
curl https://api.astrodyne.ai/v1/chat/completions \
-H "Authorization: Bearer $ASTRODYNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [{"role": "user", "content": "Hello"}]
}'
Streaming
curl
curl https://api.astrodyne.ai/v1/chat/completions \
-H "Authorization: Bearer $ASTRODYNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"stream": true,
"messages": [{"role": "user", "content": "Hello"}]
}'
With "stream": true the response is
text/event-stream: a sequence of data: lines each
carrying a chunk, terminated by data: [DONE].
List your models
curl
curl https://api.astrodyne.ai/v1/models \ -H "Authorization: Bearer $ASTRODYNE_API_KEY"
Keeping the request id
curl
curl -i https://api.astrodyne.ai/v1/chat/completions \
-H "Authorization: Bearer $ASTRODYNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "YOUR_MODEL_ID", "messages": [{"role": "user", "content": "Hello"}]}' \
| grep -i x-astrodyne-request-id
Use -i or -D to see headers
X-Astrodyne-Request-Id is returned on responses and is how you find
the request in the Request Explorer.