Claude Opus 5 API
Use model: "claude-opus-5" to call Claude Opus 5. The examples below send a synchronous request using Anthropic Messages.
These are integration examples, not recorded model outputs. Keep the key in your server environment as BEATAPI_API_KEY; replace <BEATAPI_API_KEY> in the cURL example with your own key. Do not put the key in browser code.
Send a request
POST https://api.beatapi.io/v1/messages
Install @anthropic-ai/sdk in your server project.
max_tokens: 2048 is the output budget chosen for this example, not the model’s maximum output limit. The SDK base URL omits /v1 because the SDK supplies the endpoint path.
cURL
Read and validate the result
The SDK returns the native Messages response. Read text only from blocks whose type is text; inspect stop_reason and usage from the actual response. The example accepts end_turn. Handle max_tokens as a potentially truncated answer and tool_use as a request for the application to handle tools, not as a completed task.
An HTTP 200 alone does not prove that the answer satisfies your task. Validate the content in your application. These text requests return directly; do not poll /v1/tasks for them.
Check GET /v1/models for the model IDs available to your account. This minimal example does not claim support for additional reasoning, sampling, cache-control or hosted-tool settings.

