Quickstart
Issue a key, point your client at the DI base URL, and send your first request — in about two minutes.
1 · Get an API key
Section titled “1 · Get an API key”Create a key on the API Keys page. Keys look like llm_live_… and authenticate every surface. Copy it when it is shown — the full value is only displayed once.
2 · Install an SDK
Section titled “2 · Install an SDK”DirectInference speaks the OpenAI wire format on this surface, so the stock OpenAI SDK works unchanged. Pick your language:
pip install openainpm install openai# curl ships with macOS and most Linux distributionsgo get github.com/openai/openai-go3 · Make your first call
Section titled “3 · Make your first call”Set base_url to the DI endpoint and your api_key to the key you just issued. Keep sending whatever model string your application already uses.
from openai import OpenAI
client = OpenAI( api_key="llm_live_...", base_url="https://app.directinference.com/di/v1",)
resp = client.chat.completions.create( model="gpt-5.5-mini", messages=[{"role": "user", "content": "In one sentence, what is DirectInference?"}],)
print(resp.choices[0].message.content)print("model:", resp.model) # echoes "gpt-5.5-mini"print("usage:", resp.usage) # prompt / completion / total tokensimport OpenAI from "openai";
const client = new OpenAI({ apiKey: "llm_live_...", baseURL: "https://app.directinference.com/di/v1",});
const resp = await client.chat.completions.create({ model: "gpt-5.5-mini", messages: [{ role: "user", content: "In one sentence, what is DirectInference?" }],});
console.log(resp.choices[0].message.content);console.log("model:", resp.model); // echoes "gpt-5.5-mini"console.log("usage:", resp.usage); // prompt / completion / total tokenscurl https://app.directinference.com/di/v1/chat/completions \ -H "Authorization: Bearer llm_live_..." \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5-mini", "messages": [{ "role": "user", "content": "In one sentence, what is DirectInference?" }] }'package main
import ( "context" "fmt"
"github.com/openai/openai-go" "github.com/openai/openai-go/option")
func main() { client := openai.NewClient( option.WithAPIKey("llm_live_..."), option.WithBaseURL("https://app.directinference.com/di/v1"), )
resp, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{ Model: "gpt-5.5-mini", Messages: []openai.ChatCompletionMessageParamUnion{ openai.UserMessage("In one sentence, what is DirectInference?"), }, }) if err != nil { panic(err) }
fmt.Println(resp.Choices[0].Message.Content) fmt.Println("model:", resp.Model) // echoes "gpt-5.5-mini"}4 · Use your own SDK
Section titled “4 · Use your own SDK”Already built on a specific vendor SDK? Each surface is a first-class drop-in — keep your client and just change the base URL.
OpenAI-compatible Chat completions, streaming, tools, and vision.
Anthropic Messages Messages, streaming, tool use, and PDF documents.
Gemini generateContent, streaming, and function calling.