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

# Claude API quickstart: Send Messages requests with RunBridge AI

> Call Claude models through RunBridge AI's Anthropic-compatible Messages API with curl, Python, and Node.js.

## What you will build

You will send one request to `POST /v1/messages`, print the Claude response text, and keep the code ready for Anthropic SDK or direct HTTP usage.

## Prerequisites

* A RunBridge AI API key stored in `RUNBRIDGE_API_KEY`
* A Claude model ID from the [Models page](/overview/models)
* `curl`, Python 3.10+, or Node.js 18+

## API key, base URL, authentication

Use the Anthropic-compatible Messages endpoint through RunBridge AI:

```text theme={null}
https://api.runbridge.ai/v1/messages
```

Authenticate direct HTTP requests with `x-api-key` and the Anthropic API version header:

```text theme={null}
x-api-key: $RUNBRIDGE_API_KEY
anthropic-version: 2023-06-01
```

## Code examples

Use the tabs below for copyable examples in cURL, Python, and Node.js.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.runbridge.ai/v1/messages \
    -H "Content-Type: application/json" \
    -H "x-api-key: $RUNBRIDGE_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -d '{
      "model": "your-claude-model-id",
      "max_tokens": 256,
      "messages": [
        {
          "role": "user",
          "content": "Reply with one short sentence."
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import os
  import anthropic

  client = anthropic.Anthropic(
      api_key=os.environ["RUNBRIDGE_API_KEY"],
      base_url="https://api.runbridge.ai",
  )

  message = client.messages.create(
      model="your-claude-model-id",
      max_tokens=256,
      messages=[
          {
              "role": "user",
              "content": "Reply with one short sentence.",
          }
      ],
  )

  print(message.content[0].text)
  ```

  ```javascript Node.js theme={null}
  import Anthropic from "@anthropic-ai/sdk";

  const client = new Anthropic({
    apiKey: process.env.RUNBRIDGE_API_KEY,
    baseURL: "https://api.runbridge.ai",
  });

  const message = await client.messages.create({
    model: "your-claude-model-id",
    max_tokens: 256,
    messages: [
      {
        role: "user",
        content: "Reply with one short sentence.",
      },
    ],
  });

  console.log(message.content[0].text);
  ```
</CodeGroup>

## Flow explanation

Claude Messages requests are synchronous by default. The API returns a message object in one HTTP response, and your application reads the first text content block.

Use this route when you need Claude-specific request shapes such as Anthropic message arrays, extended thinking, prompt caching, or tool use. If your application already uses the official Anthropic SDK, set the SDK base URL to `https://api.runbridge.ai` and keep the Messages API request shape.

## Common parameters

| Parameter | Use |
| - | - |
| `model` | A Claude model ID available to your account. |
| `max_tokens` | Maximum response token budget for the Messages API response. |
| `messages` | Anthropic message array with `user` and `assistant` roles. |
| `stream` | Streams incremental message events when set to `true`. |
| `thinking` | Enables Claude extended thinking when the selected model supports it. |

## Troubleshooting / FAQ

<AccordionGroup>
  <Accordion title="The request returns 401">
    Confirm that `RUNBRIDGE_API_KEY` is set in the same shell or runtime that sends the request. Do not paste a real key into source files.
  </Accordion>

  <Accordion title="The SDK still calls Anthropic directly">
    Confirm that the SDK client sets `base_url` in Python or `baseURL` in Node.js to `https://api.runbridge.ai`.
  </Accordion>

  <Accordion title="Which model should I use">
    Use a Claude model ID available to your account. This quickstart does not hardcode a Claude model because availability changes by account and model family.
  </Accordion>
</AccordionGroup>

## Next steps

* Use the [Anthropic Messages API reference](/api/text/anthropic-messages) for full request and response fields.
* Check model availability in [Models](/overview/models).
* Review retry behavior in [Error codes and retry strategy](/guides/error-codes-and-retry-strategy).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.