Skip to content

Quick Start

This page follows a proven docs-first flow while using Cubicspaces branding and endpoints.

1. Create an API key

All requests require a bearer token:

http
Authorization: Bearer YOUR_API_KEY

2. Set the base URL

text
https://api.cubicspaces.cloud/v1

3. Install the SDK

bash
pip install openai
bash
npm install openai
bash
# No SDK required

4. Send your first request

python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.cubicspaces.cloud/v1"
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Introduce Cubicspaces briefly."}
    ]
)

print(response.choices[0].message.content)
js
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_API_KEY",
  baseURL: "https://api.cubicspaces.cloud/v1"
});

const response = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Introduce Cubicspaces briefly." }
  ]
});

console.log(response.choices[0].message.content);
bash
curl https://api.cubicspaces.cloud/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Introduce Cubicspaces briefly."}
    ]
  }'

5. Common endpoints

Chat

http
POST /v1/chat/completions

Models

http
GET /v1/models

Usage

http
GET /v1/usage

Enterprise inquiries: hello@cubicspaces.ai