
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@ticos/realtime-api
Advanced tools
Official WebSocket-based Realtime API SDK for Ticos. This SDK provides real-time communication capabilities for building interactive AI applications.
The fastest way to see the SDK in action is to run the demo project:
# Clone the repository
git clone https://github.com/tiwater/ticos-realtime-api.git
cd ticos-realtime-api
# Install dependencies
pnpm install
# Build the SDK
pnpm build
# Navigate to the demo project
cd examples/realtime-chat
# Install demo dependencies
pnpm install
# Create a .env.local file with your API key
echo "NEXT_PUBLIC_TICOS_API_KEY=your_api_key_here" > .env.local
echo "NEXT_PUBLIC_TICOS_API_URL=wss://stardust.ticos.cn/realtime" >> .env.local
# Start the demo
pnpm dev
Then open http://localhost:3000 with your browser to see the chat demo in action.
To use the SDK in your own project:
# Using pnpm (recommended)
pnpm add @ticos/realtime-api
# Using npm
npm install @ticos/realtime-api
# Using yarn
yarn add @ticos/realtime-api
import { RealtimeClient } from '@ticos/realtime-api';
// Initialize the client
const client = new RealtimeClient();
// Connect to the Ticos Realtime API
await client.connect();
// Send a message
client.sendUserMessageContent([{ type: 'text', text: 'Hello, Ticos!' }]);
// Listen for responses
client.on('conversation.updated', (event) => {
if (event.item.role === 'assistant') {
console.log('Assistant response:', event.item.formatted.text);
}
});
// Wait for a completed message
const { item } = await client.waitForNextCompletedItem();
console.log('Completed response:', item);
API documentation is automatically generated using TypeDoc. To generate the documentation, run:
pnpm docs:generate
This will generate HTML documentation in the docs directory.
To convert the TypeDoc HTML documentation to Nextra-compatible Markdown format:
pnpm docs:convert
To generate documentation and convert it to Nextra format in one step:
pnpm docs:nextra
To serve the generated documentation locally:
pnpm docs:serve
The Ticos Realtime API enables real-time bidirectional communication between your application and Ticos AI models through WebSockets.
Register custom tools that can be called by the AI:
// Register a tool
client.registerTool(
{
name: 'search',
description: 'Search for information',
parameters: {
type: 'object',
properties: {
query: { type: 'string', description: 'Search query' },
},
required: ['query'],
},
},
async (parameters) => {
// Tool implementation
const result = await yourSearchImplementation(parameters.query);
return result;
}
);
// Tools are automatically called when the model invokes them
// Listen for completed items to see if a tool was executed
client.on('conversation.item.completed', (event) => {
console.log('Item completed:', event.item);
});
Send and receive audio messages:
// Send audio
const audioBuffer = new Int16Array([
/* your audio data */
]);
client.sendUserMessageContent([{ type: 'audio', audio: audioBuffer }]);
// Or stream audio input
client.appendInputAudio(audioBuffer);
client.createResponse();
// Listen for audio responses
client.on('conversation.updated', (event) => {
if (event.item.formatted?.audio) {
const audioData = event.item.formatted.audio;
// Process audio data
}
});
# Install dependencies
pnpm install
# Build the package
pnpm build
# Run tests
pnpm test
# Generate documentation
pnpm documentation
# Start development mode with watch
pnpm dev
MIT
FAQs
Official SDK for Ticos Realtime API
We found that @ticos/realtime-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.