A familiar API surface
Plan around familiar API conventions and reduce coupling between application code and model providers. Confirm supported protocols and models before integration.
Explore ↗AI API integration for businesses and developers. Bring model capabilities into your applications through familiar interfaces, and keep your team focused on the product.
import os from openai import OpenAI client = OpenAI( api_key=os.environ["OPENAI_API_KEY"], base_url=os.environ["OPENAI_BASE_URL"], ) response = client.chat.completions.create( model=os.environ["OPENAI_MODEL"], messages=[{"role": "user", "content": "Build something useful."}], )
Bring model integration, usage costs and engineering practices into one clear plan, from a first prototype to a maintainable application.
Plan around familiar API conventions and reduce coupling between application code and model providers. Confirm supported protocols and models before integration.
Explore ↗Build a consistent engineering workflow for chat, generation and tool use. Evaluate models against task quality, context needs and cost.
Explore ↗Estimate costs using explicit rate multipliers and usage units. Agree on quotas, billing rules and failure handling before going live.
Explore ↗Keep the tools you know. Start by confirming model access, then validate each integration step with a minimal request.
Choose the use case, model, budget and data boundaries.
Use server-side environment variables. Keep keys out of the browser.
Validate responses, error handling and usage before production.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["OPENAI_API_KEY"],
base_url=os.environ["OPENAI_BASE_URL"],
)
result = client.chat.completions.create(
model=os.environ["OPENAI_MODEL"],
messages=[{"role": "user", "content": "Hello, AI."}],
)
print(result.choices[0].message.content)# Set these to values confirmed by your service contact.
curl "${OPENAI_BASE_URL}/chat/completions" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \
-H "Content-Type: application/json" \
-d "{\"model\":\"${OPENAI_MODEL}\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello, AI.\"}]}"import OpenAI from "openai";
// Run on your server. Never expose a key in browser code.
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: process.env.OPENAI_BASE_URL,
});
const result = await client.chat.completions.create({
model: process.env.OPENAI_MODEL,
messages: [{ role: "user", content: "Hello, AI." }],
});
console.log(result.choices[0].message.content);From a first experiment to a carefully managed enterprise workload.
Plan AI capabilities for support, search and content workflows, with clear quality and data boundaries.
Compare models on reproducible datasets. Record parameters, versions and evaluation results.
Validate a product idea with a minimal integration before investing in scale.
Design queues, rate limits and retries to keep larger workflows manageable.
Separate model output from execution, and authorize and validate every tool call.
Understand each editor or client’s protocol requirements and verify compatibility by version.
Design tool use around permissions, validation, and explicit human decisions.
Reduce exposure through ownership, isolation, and a rehearsed response plan.
Build a repeatable selection process around tasks, data, and failure costs.
Tell us about your use case, model requirements and budget. Let’s work out a practical integration plan.