Skip to content

Modern Components Demo

Modern UI Components

Explore the beautiful, interactive components available in the UniCraft documentation

Experience code like never before with our interactive code blocks that support syntax highlighting, copy functionality, and live execution:

// Configure smart routing with UniCraft
const response = await fetch("http://localhost:8080/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer your-api-key",
},
body: JSON.stringify({
model: "smart-routing",
messages: [
{
role: "user",
content: "Explain quantum computing in simple terms",
},
],
max_tokens: 150,
temperature: 0.7,
}),
});
const data = await response.json();
console.log("AI Response:", data.choices[0].message.content);
import requests
import json
# UniCraft Python client example
class UniCraftClient:
def __init__(self, base_url="http://localhost:8080", api_key=None):
self.base_url = base_url
self.api_key = api_key
self.headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_key}'
}
def chat_completion(self, messages, model="smart-routing", **kwargs):
payload = {
'model': model,
'messages': messages,
**kwargs
}
response = requests.post(
f'{self.base_url}/v1/chat/completions',
headers=self.headers,
json=payload
)
return response.json()
# Usage example
client = UniCraftClient(api_key="your-api-key")
response = client.chat_completion([
{"role": "user", "content": "Hello, UniCraft!"}
])
print(response['choices'][0]['message']['content'])

Test API endpoints directly from the documentation:

POST /v1/chat/completions

Request Body:

{
"model": "smart-routing",
"messages": [
{
"role": "user",
"content": "What is artificial intelligence?"
}
],
"max_tokens": 150,
"temperature": 0.7
}

Response:

{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-3.5-turbo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Artificial intelligence (AI) is..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}

Discover the powerful features of UniCraft AI Model Router:

Intelligent model selection based on request characteristics, performance metrics, and cost optimization.

Automatic failover and recovery mechanisms to ensure high availability and reliability.

Distribute requests across multiple providers and models for optimal performance.

Minimize costs while maintaining quality through intelligent provider selection.

Comprehensive insights into usage patterns, performance metrics, and cost analysis.

Handle text, images, audio, and other modalities across different AI providers.

Track your UniCraft usage with real-time statistics:

  • Total Requests: 1,234,567
  • Success Rate: 99.8%
  • Average Response Time: 245ms
  • Cost Savings: $12,345
  • Active Models: 15
  • Providers: 8

Experience UniCraft’s capabilities with our interactive demo:

Choose your preferred model and set parameters like temperature and max tokens.

Type your message and see how UniCraft intelligently routes it to the best provider.

See the response, routing decision, and performance metrics in real-time.

Ready to integrate UniCraft into your application? Check out our Quick Start Guide to get up and running in minutes.