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

# Quick Start

> Get started with Hyperbolic's serverless inference API in minutes

# Inference Quick Start

Get up and running with Hyperbolic's Serverless Inference API in minutes. This guide walks you through making your first API calls for text, image, and audio generation.

## Prerequisites

<CardGroup cols={3}>
  <Card title="Hyperbolic Account" icon="user" href="https://app.hyperbolic.ai">
    Sign up for a free account
  </Card>

  <Card title="API Key" icon="key" href="https://app.hyperbolic.ai/settings/api-keys">
    Generate your API key
  </Card>

  <Card title="Python or cURL" icon="code">
    Python 3.7+ or cURL installed
  </Card>
</CardGroup>

## Get Your API Key

<Steps>
  <Step title="Log into the Dashboard">
    Go to [app.hyperbolic.ai](https://app.hyperbolic.ai) and sign in to your account.
  </Step>

  <Step title="Navigate to API Keys">
    Click on **Settings** in the sidebar, then select **API Keys**.
  </Step>

  <Step title="Create a New Key">
    Click **Create API Key** and copy the generated key.
  </Step>
</Steps>

<Warning>
  Keep your API key secure. Never expose it in client-side code or public repositories.
</Warning>

## Text Generation

Generate text using large language models with the chat completions endpoint.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import requests

    url = "https://api.hyperbolic.xyz/v1/chat/completions"
    headers = {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_API_KEY"
    }
    data = {
        "messages": [
            {"role": "user", "content": "What are three tips for learning to code?"}
        ],
        "model": "deepseek-ai/DeepSeek-V3",
        "max_tokens": 512,
        "temperature": 0.7
    }

    response = requests.post(url, headers=headers, json=data)
    print(response.json()["choices"][0]["message"]["content"])
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.hyperbolic.xyz/v1/chat/completions" \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "messages": [
          {"role": "user", "content": "What are three tips for learning to code?"}
        ],
        "model": "deepseek-ai/DeepSeek-V3",
        "max_tokens": 512,
        "temperature": 0.7
      }'
    ```
  </Tab>
</Tabs>

<Tip>
  The chat completions endpoint is OpenAI-compatible. You can use the OpenAI Python SDK by setting the base URL to `https://api.hyperbolic.xyz/v1`.
</Tip>

## Image Generation

Generate images from text prompts using state-of-the-art diffusion models.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import requests
    import base64

    url = "https://api.hyperbolic.xyz/v1/image/generation"
    headers = {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_API_KEY"
    }
    data = {
        "model_name": "FLUX.1-dev",
        "prompt": "A futuristic city skyline at sunset, cyberpunk style",
        "steps": 30,
        "cfg_scale": 5,
        "height": 1024,
        "width": 1024
    }

    response = requests.post(url, headers=headers, json=data)
    result = response.json()

    # Save the generated image
    image_data = base64.b64decode(result["images"][0]["image"])
    with open("generated_image.png", "wb") as f:
        f.write(image_data)
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.hyperbolic.xyz/v1/image/generation" \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "model_name": "FLUX.1-dev",
        "prompt": "A futuristic city skyline at sunset, cyberpunk style",
        "steps": 30,
        "cfg_scale": 5,
        "height": 1024,
        "width": 1024
      }'
    ```
  </Tab>
</Tabs>

<Warning>
  **Sunset Notice:** FLUX.1-dev and all other image generation models are being discontinued. Please plan your migration accordingly.
</Warning>

<Info>
  The response contains a base64-encoded image in the `images` array. Decode it to save or display the generated image.
</Info>

## Audio Generation

Convert text to natural-sounding speech using the audio generation endpoint.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import requests
    import base64

    url = "https://api.hyperbolic.xyz/v1/audio/generation"
    headers = {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_API_KEY"
    }
    data = {
        "text": "Welcome to Hyperbolic! This is an example of text-to-speech generation.",
        "speed": 1
    }

    response = requests.post(url, headers=headers, json=data)
    result = response.json()

    # Save the generated audio
    audio_data = base64.b64decode(result["audio"])
    with open("generated_audio.mp3", "wb") as f:
        f.write(audio_data)
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.hyperbolic.xyz/v1/audio/generation" \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "text": "Welcome to Hyperbolic! This is an example of text-to-speech generation.",
        "speed": 1
      }'
    ```
  </Tab>
</Tabs>

<Info>
  The `speed` parameter controls playback speed (1.0 is normal). The response contains base64-encoded audio data.
</Info>

## Next Steps

<CardGroup cols={3}>
  <Card title="Text APIs" icon="message" href="/docs/inference/text-apis">
    Explore chat completions and more
  </Card>

  <Card title="Image APIs" icon="image" href="/docs/inference/image-apis">
    Learn about image generation
  </Card>

  <Card title="Audio APIs" icon="volume-high" href="/docs/inference/audio-apis">
    Dive into text-to-speech
  </Card>
</CardGroup>
