Quickstart
Pick a model backend, how to run the server, and what to build. The steps below update to match.
Pull the models
Install Ollama, then pull a chat model and an embedding model. The embedding model powers the Responses API, vector stores, and file search.
ollama pull llama3.2:3bollama pull nomic-embed-textStart the server
With uv installed, start the server.
ogx gofinds the running backends, installs what they need, and starts serving.uvx ogx goThe server listens on https with a self-signed certificate and requires an API key. It prints three generated keys when it starts, and they change every time it restarts:
✓ Simple authentication enabledHere are keys you can use for authentication:ogk_...Point your tools at the server
In the terminal where you run the examples, tell clients where the server is. The Python examples and
ogx connectboth read these variables.export OGX_BASE_URL=https://localhost:8321/v1export OGX_API_KEY=ogk_... # one of the keys ogx go printedCheck that it works
List the models the server registered. You should see
ollama/llama3.2:3bamong them.curl -k -s -H "Authorization: Bearer $OGX_API_KEY" $OGX_BASE_URL/modelsCall it with the OpenAI SDK
Point the OpenAI SDK you already use at OGX:
app.pyimport osfrom openai import DefaultHttpxClient, OpenAIclient = OpenAI(base_url=os.environ["OGX_BASE_URL"],# Servers started with --no-auth accept any keyapi_key=os.environ.get("OGX_API_KEY", "unused"),# ogx go serves a self-signed certificate, so skip verification for local usehttp_client=DefaultHttpxClient(verify=False),)response = client.responses.create(model="ollama/llama3.2:3b",input="In one sentence, what is an API server?",)print(response.output_text)pip install openaipython app.py
uvx is great for trying things out. For a real project, install into a persistent environment:
uv init my-ai-app && cd my-ai-app
uv add ogx openai
uv run ogx go
Troubleshooting
Port already in use
If you see Address already in use, another process is using port 8321. Either stop it or run on a different port, and use that port in OGX_BASE_URL:
uvx ogx go --port 8322
Connection refused or connection error
If curl returns Connection refused, the server has not finished starting. Wait a few seconds for model registration to complete, then try again. Check the terminal where you started the server for errors.
If the Python client raises APIConnectionError, check that OGX_BASE_URL starts with https://. ogx go only listens on http when started with --insecure.
Authentication required
If the API returns Authentication required, the request is missing a valid API key. Export one of the keys printed by the running ogx go:
export OGX_API_KEY=ogk_...
Keys from an earlier run stop working when the server restarts.
Responses API returns Not Found
If client.responses.create fails with Not Found, look for this line in the ogx go output:
✗ No embedding model detected — vector stores, file-search, and responses disabled.
Pull an embedding model and restart the server:
ollama pull nomic-embed-text
uvx ogx go
To use a different embedding model, pass --default-embedding-model PROVIDER_ID/MODEL_ID --default-embedding-dimension DIMENSION.
Model not found
If the API returns an error about a model not being found, make sure you pulled the model first. For Ollama:
ollama pull llama3.2:3b
Then restart the OGX server, and check which models it registered:
curl -k -s -H "Authorization: Bearer $OGX_API_KEY" $OGX_BASE_URL/models
Coding agent replies are empty
Ollama's default context window is smaller than a coding agent's prompt, so the model only sees part of it. Restart Ollama with a larger window:
OLLAMA_CONTEXT_LENGTH=16384 ollama serve
What's next?
- Use the OpenAI SDK - full compatibility guide
- Try the Responses API - build agents with tool calling
- Add vector search - RAG with file search and vector stores
- Connect Claude Code, Codex, or opencode - coding agents on your own models
- See all providers - swap to vLLM, Bedrock, Azure, and more