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

# Quickstart

> Make your first model call in a few lines of code.

export const ConsoleLink = ({path = "/console", children}) => <a href={"http://localhost:3001" + path} target="_blank" rel="noopener noreferrer">{children}</a>;

<Info>One API key connects you to multiple model providers. Copy the actual regional Base URL and model ID from the console. The values below are placeholders.</Info>

<Steps>
  <Step title="Create an API key">
    Create a separate key for your application and keep it in an environment variable.

    ```bash theme={null}
    export CODEFLARE_API_KEY="YOUR_CODEFLARE_KEY"
    ```

    <ConsoleLink path="/console/keys">Manage API keys ↗</ConsoleLink>
  </Step>

  <Step title="Choose a region and model">
    Copy the selected region's Base URL from the keys page. Copy a Responses-compatible model ID from its details in the catalog.

    | Setting | Placeholder |
    | - | - |
    | Base URL | `https://YOUR-REGION.example/v1` |
    | Model ID | `MODEL_ID` |

    <ConsoleLink path="/console/models">Browse models and protocols ↗</ConsoleLink>
  </Step>

  <Step title="Make your first request">
    Install the SDK, then replace the URL and model. For Python, run `python -m pip install openai`; for JavaScript, run `npm install openai`.

    <CodeGroup>
      ```python Python theme={null}
      from openai import OpenAI
      import os

      client = OpenAI(
          api_key=os.environ["CODEFLARE_API_KEY"],
          base_url="https://YOUR-REGION.example/v1",
          max_retries=0,
      )
      response = client.responses.create(
          model="MODEL_ID", input="Hello",
          max_output_tokens=256, store=False,
      )
      print(response.output_text)
      ```

      ```javascript JavaScript theme={null}
      import OpenAI from "openai";

      const client = new OpenAI({
        apiKey: process.env.CODEFLARE_API_KEY,
        baseURL: "https://YOUR-REGION.example/v1",
        maxRetries: 0,
      });
      const response = await client.responses.create({
        model: "MODEL_ID", input: "Hello",
        max_output_tokens: 256, store: false,
      });
      console.log(response.output_text);
      ```

      ```bash cURL theme={null}
      curl "https://YOUR-REGION.example/v1/responses" \
        -H "Authorization: Bearer $CODEFLARE_API_KEY" \
        -H 'Content-Type: application/json' \
        -d '{"model":"MODEL_ID","input":"Hello","max_output_tokens":256,"store":false}'
      ```
    </CodeGroup>
  </Step>
</Steps>

<Warning>Check the result after an interruption before sending another generation request. These examples disable automatic SDK retries and do not run requests for you.</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Protocols and authentication" icon="code" href="/en/api/overview">Choose the request format supported by your model.</Card>
  <Card title="Set up Codex CLI" icon="terminal" href="/en/tools/codex">Connect through a custom Responses provider.</Card>
  <Card title="Set up Claude Code" icon="terminal" href="/en/tools/claude-code">Connect through an Anthropic Messages gateway.</Card>
  <Card title="Troubleshoot requests" icon="circle-question" href="/en/troubleshooting">Check keys, balance, regions, and capabilities.</Card>
</CardGroup>


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