Skip to main content

Quickstart Guide

Get up and running with our platform in just a few minutes.

Prerequisites

Before you begin, make sure you have:

  • A valid account (sign up at console.example.com)
  • An API key from your dashboard
  • Node.js 18+ or Python 3.8+ installed

Installation

JavaScript/TypeScript

npm install @yourcompany/sdk

Python

pip install yourcompany-sdk

Authentication

All API requests require authentication using your API key. You can find your API key in the console.

import { Client } from '@yourcompany/sdk';

const client = new Client({
apiKey: process.env.YOUR_API_KEY
});
from yourcompany import Client

client = Client(api_key=os.environ['YOUR_API_KEY'])

Making Your First Request

Here's how to make your first API call:

JavaScript

const result = await client.generate({
prompt: "Hello, world!",
maxTokens: 100
});

console.log(result.text);

Python

result = client.generate(
prompt="Hello, world!",
max_tokens=100
)

print(result.text)

Response Format

API responses are returned in JSON format:

{
"id": "req_abc123",
"text": "Hello! How can I help you today?",
"usage": {
"promptTokens": 3,
"completionTokens": 8,
"totalTokens": 11
},
"createdAt": "2025-01-15T12:00:00Z"
}

Error Handling

Handle errors gracefully in your application:

try {
const result = await client.generate({
prompt: "Hello, world!"
});
} catch (error) {
if (error.status === 401) {
console.error('Invalid API key');
} else if (error.status === 429) {
console.error('Rate limit exceeded');
} else {
console.error('An error occurred:', error.message);
}
}

Rate Limits

Free tier: 100 requests/day Pro tier: 10,000 requests/day Enterprise: Custom limits

Next Steps