How to beginner · 3 min read

Fireworks AI model not available fix

Quick answer
Use the correct Fireworks AI model name prefix accounts/fireworks/models/ when specifying the model parameter in your API call. Ensure your base_url is set to https://api.fireworks.ai/inference/v1 and your API key is loaded from os.environ to avoid model not found errors.

PREREQUISITES

  • Python 3.8+
  • Fireworks AI API key
  • pip install openai>=1.0

Setup

Install the openai Python package version 1.0 or higher. Set your Fireworks AI API key in the environment variable FIREWORKS_API_KEY. Use the OpenAI SDK with the Fireworks base URL to access Fireworks AI models.
bash
pip install openai>=1.0
output
Collecting openai
  Downloading openai-1.x.x-py3-none-any.whl (xx kB)
Installing collected packages: openai
Successfully installed openai-1.x.x

Step by step

Use the OpenAI SDK with the Fireworks AI base URL and specify the full model name including the accounts/fireworks/models/ prefix. This example sends a chat completion request and prints the assistant's reply.
python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["FIREWORKS_API_KEY"],
    base_url="https://api.fireworks.ai/inference/v1"
)

response = client.chat.completions.create(
    model="accounts/fireworks/models/llama-v3p3-70b-instruct",
    messages=[{"role": "user", "content": "Hello, Fireworks AI!"}]
)

print(response.choices[0].message.content)
output
Hello, Fireworks AI! How can I assist you today?

Common variations

You can switch to other Fireworks AI models by changing the model parameter but always keep the accounts/fireworks/models/ prefix. For async usage, use asyncio with the OpenAI client. Streaming is supported via stream=True in chat.completions.create.
python
import os
import asyncio
from openai import OpenAI

async def main():
    client = OpenAI(
        api_key=os.environ["FIREWORKS_API_KEY"],
        base_url="https://api.fireworks.ai/inference/v1"
    )

    stream = await client.chat.completions.create(
        model="accounts/fireworks/models/llama-v3p3-70b-instruct",
        messages=[{"role": "user", "content": "Stream a response."}],
        stream=True
    )

    async for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="", flush=True)

asyncio.run(main())
output
Streaming response text from Fireworks AI model...

Troubleshooting

  • If you get a model not found error, verify you are using the full model name with the accounts/fireworks/models/ prefix.
  • Ensure your FIREWORKS_API_KEY environment variable is set correctly.
  • Check your base_url is https://api.fireworks.ai/inference/v1.
  • For permission errors, confirm your API key has access to the requested model.

Key Takeaways

  • Always use the full Fireworks AI model name starting with accounts/fireworks/models/.
  • Set base_url to https://api.fireworks.ai/inference/v1 when using OpenAI SDK.
  • Load your API key from the FIREWORKS_API_KEY environment variable.
  • Use streaming and async features with the OpenAI SDK for Fireworks AI.
  • Check model name and API key permissions if you encounter model not found errors.
Verified 2026-04 · accounts/fireworks/models/llama-v3p3-70b-instruct
Verify ↗