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

# Deployments Quickstart

> Deploy open-source models on dedicated GPUs on Fireworks in minutes, covering deployment creation, GPU sizing, and calling the endpoint from the API.

On-demand deployments are dedicated GPUs that give you better performance, no rate limits, fast autoscaling, and a wider selection of models than serverless. This quickstart will help you spin up your first on-demand deployment in minutes.

## Step 1: Create and export an API key

Before you begin, create an API key in the [Fireworks dashboard](https://app.fireworks.ai/settings/users/api-keys). Click **Create API key** and store it in a safe location.

Once you have your API key, export it as an environment variable in your terminal:

> [tab] macOS / Linux
>
> ```bash theme={null}
> export FIREWORKS_API_KEY="your_api_key_here"
> ```

> [tab] Windows
>
> ```powershell theme={null}
> setx FIREWORKS_API_KEY "your_api_key_here"
> ```

## Step 2: Install the CLI

To create and manage on-demand deployments, you'll need the `firectl` CLI tool. Install it using one of the following methods, based on your platform:

```bash homebrew theme={null}
brew tap fw-ai-external/firectl
brew install firectl

# If you encounter a failed SHA256 check, try first running
brew update
```

```bash macOS (Apple Silicon) theme={null}
curl https://storage.googleapis.com/fireworks-public/firectl/stable/darwin-arm64.gz -o firectl.gz
gzip -d firectl.gz && chmod a+x firectl
sudo mv firectl /usr/local/bin/firectl
sudo chown root: /usr/local/bin/firectl
```

```bash macOS (x86_64) theme={null}
curl https://storage.googleapis.com/fireworks-public/firectl/stable/darwin-amd64.gz -o firectl.gz
gzip -d firectl.gz && chmod a+x firectl
sudo mv firectl /usr/local/bin/firectl
sudo chown root: /usr/local/bin/firectl
```

```bash Linux  (x86_64) theme={null}
wget -O firectl.gz https://storage.googleapis.com/fireworks-public/firectl/stable/linux-amd64.gz
gunzip firectl.gz
sudo install -o root -g root -m 0755 firectl /usr/local/bin/firectl
```

```Text Windows (64 bit) theme={null}
wget -L https://storage.googleapis.com/fireworks-public/firectl/stable/firectl.exe
```

Then, sign in:

```bash theme={null}
firectl signin
```

## Step 3: Create a deployment

This command will create a deployment of GPT OSS 120B. It will take a few minutes to complete. The resulting deployment will scale up to 1 replica.

Requires `firectl` 1.8.8 or newer — on older versions, `default` is treated as a literal shape name and the command fails. Check with `firectl version`.

```bash theme={null}
firectl deployment create accounts/fireworks/models/gpt-oss-120b \
        --deployment-shape default \
        --scale-down-window 5m \
        --scale-up-window 30s \
        --min-replica-count 0 \
        --max-replica-count 1 \
        --scale-to-zero-window 5m \
        --wait
```

> [!TIP]
>
> A [deployment shape](https://fireworks.ai/docs/guides/ondemand-deployments.md#deployment-shapes) is a pre-configured deployment template created by the Fireworks team that sets sensible defaults for most deployment options (such as hardware type).
>
> `--deployment-shape default` tells Fireworks to pick a validated shape for the model. To optimize for lower cost-per-token at scale or the lowest cost at small scale, run `firectl deployment-shape-version match --model <model-id>` and pass a shape with preset type `THROUGHPUT` or `MINIMAL` instead — pass the shape's full resource name to `--deployment-shape`; preset types are not shape identifier aliases.
>
> Do not omit `--deployment-shape`: deployments created without a shape do not start from a validated configuration and are much more likely to fail at creation. If no shape fits your workload, [contact us](https://fireworks.ai/contact); if you deliberately need a shapeless deployment, pass `--accept-shapeless-risk` (advanced users only). See [Deployment shapes](https://fireworks.ai/docs/guides/ondemand-deployments.md#deployment-shapes) and [Explicitly creating a deployment without a shape](https://fireworks.ai/docs/guides/ondemand-deployments.md#explicitly-creating-a-deployment-without-a-shape-advanced-users-only) in the deployment guide.

The response will look like this:

```bash theme={null}
Name: accounts/<YOUR ACCOUNT ID>/deployments/<DEPLOYMENT ID>
Create Time: <CREATION_TIME>
Expire Time: <EXPIRATION_TIME>
Created By: <YOUR EMAIL>
State: CREATING
Status: OK
Min Replica Count: 0
Max Replica Count: 1
Desired Replica Count: 0
Replica Count: 0
Autoscaling Policy:
  Scale Up Window: 30s
  Scale Down Window: 5m0s
  Scale To Zero Window: 5m0s
Base Model: accounts/fireworks/models/gpt-oss-120b
...other fields...
```

Take note of the `Name:` field in the response, as it will be used in the next step to query your deployment.

[Learn more about deployment options→](https://fireworks.ai/docs/guides/ondemand-deployments.md)

[Learn more about autoscaling options→](https://fireworks.ai/docs/guides/ondemand-deployments.md#autoscaling)

## Step 4: Query your deployment

Now you can query your on-demand deployment using the same API as serverless models, but using your dedicated deployment. Replace `<DEPLOYMENT_NAME>` in the below snippets with the value from the `Name:` field in the previous step:

> [tab] Python (Fireworks SDK)
>
> Install the [Fireworks Python SDK](https://fireworks.ai/docs/tools-sdks/python-sdk.md):
>
> ```bash pip theme={null}
> python -m pip install --upgrade fireworks-ai
> ```
>
> ```bash poetry theme={null}
> poetry add fireworks-ai
> ```
>
> ```bash uv theme={null}
> uv add fireworks-ai
> ```
>
> Then make your first on-demand API call:
>
> ```python theme={null}
> from fireworks import Fireworks
>
> client = Fireworks()
>
> response = client.chat.completions.create(
>     model="accounts/fireworks/models/gpt-oss-120b#<DEPLOYMENT_NAME>",
>     messages=[{
>         "role": "user",
>         "content": "Explain quantum computing in simple terms",
>     }],
> )
>
> print(response.choices[0].message.content)
> ```

> [tab] Python (OpenAI SDK)
>
> ```python theme={null}
> import os
> from openai import OpenAI
>
> client = OpenAI(
>     api_key=os.environ.get("FIREWORKS_API_KEY"),
>     base_url="https://api.fireworks.ai/inference/v1"
> )
>
> response = client.chat.completions.create(
>     model="<DEPLOYMENT_NAME>",
>     messages=[{
>         "role": "user",
>         "content": "Explain quantum computing in simple terms",
>     }],
> )
>
> print(response.choices[0].message.content)
> ```

> [tab] JavaScript
>
> ```javascript theme={null}
> import OpenAI from "openai";
>
> const client = new OpenAI({
>   apiKey: process.env.FIREWORKS_API_KEY,
>   baseURL: "https://api.fireworks.ai/inference/v1",
> });
>
> const response = await client.chat.completions.create({
>   model: "<DEPLOYMENT_NAME>",
>   messages: [
>     {
>       role: "user",
>       content: "Explain quantum computing in simple terms",
>     },
>   ],
> });
>
> console.log(response.choices[0].message.content);
> ```

> [tab] curl
>
> ```bash theme={null}
> curl https://api.fireworks.ai/inference/v1/chat/completions \
>   -H "Content-Type: application/json" \
>   -H "Authorization: Bearer $FIREWORKS_API_KEY" \
>   -d '{
>     "model": "<DEPLOYMENT_NAME>",
>     "messages": [
>       {
>         "role": "user",
>         "content": "Explain quantum computing in simple terms"
>       }
>     ]
>   }'
> ```

The examples from the Serverless quickstart will work with this deployment as well, just replace the model string with the deployment-specific model string from above.

[Serverless quickstart→](https://fireworks.ai/docs/getting-started/quickstart.md)

## Common use cases

### Autoscale based on requests per second

```bash theme={null}
firectl deployment create accounts/fireworks/models/gpt-oss-120b \
        --deployment-shape default \
        --scale-down-window 5m \
        --scale-up-window 30s \
        --scale-to-zero-window 5m \
        --min-replica-count 0 \
        --max-replica-count 4 \
        --load-targets requests_per_second=5 \
        --wait
```

### Autoscale based on concurrent requests

```bash theme={null}
firectl deployment create accounts/fireworks/models/gpt-oss-120b \
        --deployment-shape default \
        --scale-down-window 5m \
        --scale-up-window 30s \
        --scale-to-zero-window 5m \
        --min-replica-count 0 \
        --max-replica-count 4 \
        --load-targets concurrent_requests=5 \
        --wait
```

## Next steps

Ready to scale to production, explore other modalities, or customize your models?

> [card] [Upload a custom model](https://fireworks.ai/docs/models/uploading-custom-models.md)
>
> Bring your own model and deploy it on Fireworks

> [card] [Train Models](https://fireworks.ai/docs/fine-tuning/finetuning-intro.md)
>
> Improve model quality with supervised and reinforcement learning

> [card] [Embeddings & Reranking](https://fireworks.ai/docs/guides/querying-embeddings-models.md)
>
> Use embeddings & reranking in search & context retrieval

> [card] [Batch Inference](https://fireworks.ai/docs/guides/batch-inference.md)
>
> Run async inference jobs at scale, faster and cheaper

> [card] [Browse 100+ Models](https://fireworks.ai/models)
>
> Explore all available models across modalities

> [card] [API Reference](https://fireworks.ai/docs/api-reference/introduction.md)
>
> Complete API documentation


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