Compatibility base URL
/chat/completions, producing this request URL:
gengen_live_.
Python
Install the OpenAI Python SDK:JavaScript
Install the OpenAI JavaScript SDK:baseURL when creating the client:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use GENGEN chat models with the OpenAI Python or JavaScript SDK.
https://gengen.farm/v1
/chat/completions, producing this request URL:
https://gengen.farm/v1/chat/completions
gengen_live_.
/v1 compatibility base URL currently supports Chat Completions only.
Do not assume that OpenAI SDK resources such as Responses, Models, Images,
Files, or Assistants are available through this base URL. Use the documented
canonical GENGEN endpoints for other capabilities.pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["GENGEN_API_KEY"],
base_url="https://gengen.farm/v1",
)
completion = client.chat.completions.create(
model="seed-2-0-lite-260428",
messages=[
{
"role": "user",
"content": "Explain idempotency in two sentences.",
}
],
)
print(completion.choices[0].message.content)
npm install openai
baseURL when creating the client:
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.GENGEN_API_KEY,
baseURL: "https://gengen.farm/v1",
});
const completion = await client.chat.completions.create({
model: "seed-2-0-lite-260428",
messages: [
{
role: "user",
content: "Explain idempotency in two sentences.",
},
],
});
console.log(completion.choices[0].message.content);
POST https://gengen.farm/api/gengen/v1/chat/completions