-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI key
More file actions
executable file
·33 lines (28 loc) · 1020 Bytes
/
Copy pathAPI key
File metadata and controls
executable file
·33 lines (28 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# Nanobridge API examples. Set NANOBRIDGE_API_KEY before running.
set -euo pipefail
: "${NANOBRIDGE_API_KEY:?Set NANOBRIDGE_API_KEY first}"
OPENAI_BASE="${NANOBRIDGE_API_BASE:-https://api.nanobridge.net/v1}"
ANTHROPIC_BASE="${NANOBRIDGE_ANTHROPIC_BASE:-https://api.nanobridge.net/anthropic}"
echo "=== OpenAI Chat Completions (non-stream) ==="
curl -sS "${OPENAI_BASE%/}/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${NANOBRIDGE_API_KEY}" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false
}'
echo ""
echo "=== Anthropic Messages ==="
curl -sS "${ANTHROPIC_BASE%/}/v1/messages" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${NANOBRIDGE_API_KEY}" \
-d '{
"model": "deepseek-v4-flash",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello!"}]
}'