|
|
<#>- curl -v https://hkcn2.dpdns.org/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-3ynxxtreen3q8vjqaffnechlhhaw1094o3pshz0epcj5xdw3" \
-d '{
"model": "claude-haiku-4-5-20251001",
"messages": [{"role": "user", "content": "hi"}]
}'
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
> POST /api/v1/chat/completions HTTP/2
> Host: hkcn2.dpdns.org
> User-Agent: curl/8.15.0
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer sk-3ynxxtreen3q8vjqaffnechlhhaw1094o3pshz0epcj5xdw3
> Content-Length: 99
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/2 200
< date: Mon, 16 Mar 2026 09:37:58 GMT
< content-type: application/json; charset=utf-8
< content-length: 379
< server: cloudflare
< customize: HaoHao
< author: sendAPI
< access-control-allow-credentials: true
< access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
< access-control-expose-headers: Content-Type,Content-Length
< vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
< strict-transport-security: max-age=31536000
< alt-svc: h3=":443"; ma=86400
< cf-cache-status: DYNAMIC
< nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
< report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=SFhtzFoHj76OizuHhROHiSQMAVdcqjLGCPEAk7DHcMLmIonkutwhAAVf87hWiOyazYf%2BQ%2Bi%2FcWHOH%2BiCNh9RiBB%2BJVdIvprrXFM4zW58jseRjnAWJdNqX0Z3MA%3D%3D"}]}
< cf-ray: 9dd2c7fdfed1b1bf-HKG
<
{"id":"msg_619be1700f4b4e55a43896781fb5ff6e","object":"message","created":1773653878,"model":"claude-haiku-4-5-20251001","choices":[{"index":0,"message":{"role":"assistant","content":"Hey there. What can I help you with today?"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":1024,"completion_tokens":14,"total_tokens":2061,"cache_creation_input_tokens":1023}}#
-<ROOT@MyWrt-X86:~>- -<pts/0>-
-<#>- curl -s https://hkcn2.dpdns.org/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-3ynxxtreen3q8vjqaffnechlhhaw1094o3pshz0epcj5xdw3" \
-d '{
"model": "claude-haiku-4-5-20251001",
"messages": [{"role": "user", "content": "在 OpenWrt 系统中,如何通过命令行重启系统?请简洁回复。"}]
}' | grep -o '"content":"[^"]*"'
"content":"在 OpenWrt 中重启系统,使用以下命令:\n\n```bash\nreboot\n```\n\n或者:\n\n```bash\n/sbin/reboot\n```\n\n如果需要延迟重启(比如延迟 10 秒),可以用:\n\n```bash\nsleep 10 \u0026\u0026 reboot\n```" |
|