Code Examples
Complete code examples for all Tenzro services across different programming languages. Copy, paste, and adapt these examples for your applications.
Examples by Language
JavaScript/TypeScript
JavaScript/TypeScript Examples
Complete examples using the JavaScript/TypeScript SDK
Python
Python Examples
Python examples for data science and backend applications
cURL
cURL Examples
Raw HTTP requests for testing and shell scripting
Quick Examples
AI Text Generation
Generate text with GPT-4o or Claude
// JavaScript
const response = await tenzro.cortex.generate({
prompt: "Write a poem about AI",
model: "gpt-4o"
});
Deploy from GitHub
Deploy a web app to production
# cURL
curl -X POST https://api.tenzro.com/factory/deployments \
-H "X-API-Key: sk_your_key_here" \
-d '{"github_url": "https://github.com/user/app"}'
Train ML Model
Submit a GPU training job
# Python
job = client.grid.train(
name="bert-training",
framework="pytorch-latest",
gpu_type="A100"
)
Popular Use Cases
AI-Powered Applications
Build chatbots, content generators, and AI assistants with Cortex AI
Web Application Deployment
Deploy React, Next.js, and full-stack applications instantly
Machine Learning Training
Train custom models on distributed GPUs with cost optimization
Data Processing Pipelines
Build secure data pipelines with Storage and Ledger encryption
Getting Started with Examples
1. Choose Your Language
Pick JavaScript, Python, or cURL based on your tech stack
2. Get Your API Key
Sign up at platform.tenzro.com and generate your API key
3. Copy & Run
Copy examples and replace with your API key to get started
Need help? Check out our Quick Start guide or contact support