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

# Quick Start

<Callout icon="sparkle" color="#0037ff" iconType="regular">
  [Get API Access <Icon icon="arrow-up-right" />](https://tally.so/r/mYNDW5)
</Callout>

<Callout icon="play" color="#0037ff" iconType="regular">
  [Test API's Endpoints](/apis/api-reference-intro)
</Callout>

This guide provides an example on how to use the API endpoint.

## Prerequisites

**Base URL:** `https://api.fortytwo.network/v1`<br />
**Network access to:**`https://api.fortytwo.network/`<br />
**Authentication Token:** `YOUR_FORTYTWO_API_KEY`

<Note>
  OpenAI SDK v1.0+ is required for SDK Integration.
</Note>

<Callout icon="key" color="#FFC107" iconType="regular">
  **Keep your API key secure!** Your API key should be treated like a password. Never share it publicly or commit it to version control systems.
</Callout>

## Usage

<Tabs>
  <Tab title="Curl" icon="brackets-curly">
    **List available models:**

    ```bash Bash lines theme={null}
      curl https://api.fortytwo.network/v1/models \
        -H "Authorization: Bearer $YOUR_FORTYTWO_API_KEY"
    ```

    **Chat completions:**

    ```bash Bash lines theme={null}
      curl -X POST https://api.fortytwo.network/v1/chat/completions \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $YOUR_FORTYTWO_API_KEY" \
        -d '{
          "model": "fortytwo-xxxxxxxxxxxx",
          "messages": [
            {"role": "user", "content": "Hi, network!"}
          ]
        }'
    ```
  </Tab>

  <Tab title="SDK Integration" icon="code">
    **Python and TypeScript integration example:**

    <CodeGroup>
      ```python Python lines theme={null}
        from openai import OpenAI
        client = OpenAI(
          base_url="https://api.fortytwo.network/v1",
          api_key="<YOUR_FORTYTWO_API_KEY>",
        )
        completion = client.chat.completions.create(
          model="fortytwo-xxxxxxxxxxxx",
          messages=[
            {
              "role": "user",
              "content": "Hi, network!"
            }
          ]
        )
        print(completion.choices[0].message.content)
      ```

      ```typescript TypeScript lines theme={null}
        import OpenAI from 'openai';

        const openai = new OpenAI({
          baseURL: 'https://api.fortytwo.network/v1',
          apiKey: "<YOUR_FORTYTWO_API_KEY>",
        });

        async function main() {
          const completion = await openai.chat.completions.create({
            model: 'fortytwo-xxxxxxxxxxxx',
            messages: [
              {
                role: 'user',
                content: 'Hi, network!',
              },
            ],
          });

          console.log(completion.choices[0].message);
        }

        main();
      ```
    </CodeGroup>
  </Tab>
</Tabs>
