Create account
For businesses and self-employed professionals only

Menu

All guides

From Groq to FlowModels.

If you already use Groq through the OpenAI SDK, almost everything stays the same. From then on, groq/ goes in front of the model name.

What changes

The base URL, the key and the model name. Everything else stays, as long as you do not use any of the fields in the table below.

Setting Before On FlowModels
Base URL https://api.groq.com/openai/v1 https://api.flowmodels.one/v1
Key GROQ_API_KEY FLOWMODELS_API_KEY
Model name llama-3.1-8b-instant groq/llama-3.1-8b-instant

The code before and after

  client = OpenAI(
-     base_url="https://api.groq.com/openai/v1",
-     api_key=os.environ["GROQ_API_KEY"],
+     base_url="https://api.flowmodels.one/v1",
+     api_key=os.environ["FLOWMODELS_API_KEY"],
  )
  
  response = client.chat.completions.create(
-     model="llama-3.1-8b-instant",
+     model="groq/llama-3.1-8b-instant",
      messages=[{"role": "user", "content": "Hello!"}],
  )

Fields that behave differently

What the chosen model supports decides. The fields it accepts are listed under supported_parameters in GET /v1/models.

Field Behavior on FlowModels
Model IDs with a slash The ID keeps its slashes: qwen/qwen3.8-27b becomes groq/qwen/qwen3.8-27b.
response_format If the word “json” is missing from the messages with json_object, FlowModels adds a short hint so that Groq accepts the call.
reasoning_effort Only on models with reasoning. The levels are listed under capabilities.reasoning_levels; any other level results in 400 unsupported_for_model.
tools, tool_choice Type function only. FlowModels does not run your functions; the model reports tool_calls.

What to check after the move

  • The new key is in FLOWMODELS_API_KEY, and GET /v1/models lists your model.
  • A call without streaming returns choices[0].message.content as expected.
  • With stream: true the events arrive; with stream_options.include_usage the usage is in the last event.
  • Tool calls and response_format work with exactly the model you use.
  • Your error handling separates 429 insufficient_quota (credit exhausted) from 429 rate_limit_exceeded, 429 concurrent_requests_exceeded and 503 provider_overloaded.
  • The request log in your dashboard shows the model, tokens and cost of the call.
  • If you use the Groq SDK, switch to the OpenAI SDK; the fields stay the same.

Create a key, name a model, start building.

FlowModels is aimed exclusively at businesses and self-employed professionals.