ModelKit
ModelKit is the unified model gateway inside AgentOS.
If your app already has its own complex agent, or if you only need direct model access, this is usually the best place to start.
What it solves
Its main value is that developers do not have to solve model sourcing first.
It exposes model capabilities by task:
| Task | Route prefix | Description |
|---|---|---|
chat | /modelkit/chat | Text and vision models through the OpenAI chat completions protocol |
embedding | /modelkit/embedding | Text embeddings |
asr | /modelkit/asr | Speech-to-text |
tts | /modelkit/tts | Text-to-speech |
Best fit
- you already own the agent runtime and only need the model-calling layer
- you want to call models directly through the AgentOS SDK or OpenAI-compatible protocol
- you want one gateway for text, multimodal, TTS, ASR, and embeddings
Most common usage
Use the AgentOS SDK
Both TypeScript and Dart SDKs expose ModelKit through sdk.modelkit.
ts
import { AgentOSSDK, ModelTask } from 'agentos-sdk-ts';
const sdk = new AgentOSSDK({ baseUrl: 'http://127.0.0.1:8888' });
const chatModels = await sdk.modelkit.listModelsByTask(ModelTask.chat);
const completion = await sdk.modelkit.chat.create({
model: chatModels[0].id,
messages: [{ role: 'user', content: 'Hello from ModelKit.' }]
});Use the OpenAI SDK directly
AgentOS task routes expose OpenAI-compatible protocols, so in many cases you can use the official OpenAI SDK directly. Make sure baseURL points to the specific task prefix.
Parameter mapping:
| OpenAI SDK field | AgentOS source |
|---|---|
baseURL | For chat, ${baseUrl}/modelkit/chat/v1, where baseUrl comes from root GET / |
apiKey | bearer token returned by AppKit registration |
model | model.id from sdk.modelkit.listModelsByTask(ModelTask.chat) |
Capability scope
chat completions:/modelkit/chat/v1/chat/completions- image-related model input: still use
/modelkit/chat; checkcapabilities.vision tts:/modelkit/tts/v1/audio/speechasr:/modelkit/asr/v1/audio/transcriptionsembeddings:/modelkit/embedding/v1/embeddings
When ModelKit should not be your first stop
- you need more than model calls and want the platform to orchestrate the agent and tool chain
- you need ready-made RAG services rather than standalone embeddings
In those cases, start with:
Next steps
- Read TypeScript Quickstart
- Read TypeScript Minimal App
- Read Choose Your Stack
