> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rockapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# curl 示例

> 使用 curl 调用 Rock API。

# curl 示例

```bash theme={null}
curl https://rockapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $ROCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
```

<Card title="获取 API Key" icon="key" href="https://rockapi.ai/keys">
  运行示例前，请先注册并创建 [API Key](https://rockapi.ai/keys)。
</Card>
