Create account
For businesses and self-employed professionals only

Menu

All guides

From OpenAI to FlowModels.

If you use the OpenAI SDK, you change the base URL and the key and write the model as provider/model.

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.openai.com/v1 https://api.flowmodels.one/v1
Key OPENAI_API_KEY FLOWMODELS_API_KEY
Model name gpt-5-mini openai/gpt-5-mini

The code before and after

  from openai import OpenAI
  
  client = OpenAI(
-     api_key=os.environ["OPENAI_API_KEY"],
+     base_url="https://api.flowmodels.one/v1",
+     api_key=os.environ["FLOWMODELS_API_KEY"],
  )
  
  response = client.chat.completions.create(
-     model="gpt-5-mini",
+     model="openai/gpt-5-mini",
      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
n, logprobs, top_logprobs, audio, store, metadata, previous_response_id, background, conversation, webhook_endpoint_id On /v1/chat/completions the API answers with 400 unsupported_field instead of quietly ignoring them. On /v1/responses, background, store, conversation, webhook_endpoint_id and metadata are allowed.
max_tokens, max_completion_tokens Both spellings work. Without a value the maximum of the model applies, and the highest possible amount is reserved before the call.
temperature, top_p Models with fixed sampling values answer these fields with 400 unsupported_for_model. Check supported_parameters.
response_format text, json_object and json_schema. If the model cannot produce the shape, you get 400 unsupported_for_model. If the word “json” is missing from the messages with json_object, FlowModels adds a short hint.
tools, tool_choice Type function only. FlowModels does not run your functions; the model reports tool_calls. Built-in tools such as web_search or code_interpreter do not exist here as a tool type; on models that support it, you turn on web search with web_search: true.
stream_options Only include_usage is allowed, and only together with stream: true.

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.
  • OpenAI text models are in the catalog from GPT-5 on. If you use older ones, pick a model from the list before you move.
  • You generate images through POST /v1/images/generations in the OpenAI format, only with the sizes square, portrait, landscape and 2k instead of pixel values and with exactly one image per request. FlowModels does not offer batch, assistants or fine-tuning. Those calls stay with OpenAI.

Create a key, name a model, start building.

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