Before you begin
Create an API key in the FreeModel Console under API Keys. Add prepaid balance under Billing before sending requests.Send a chat completion
Set your key in the current shell, then run the request.choices[0].message.content.
Use an OpenAI SDK
FreeModel works with the official OpenAI SDKs. Setbase_url to the FreeModel API base URL.
Stream the response
Setstream to true to receive server-sent events as text is generated.