Huddle01 Cloud

API Examples

Connect to Huddle01 AI inference using OpenAI-compatible APIs and SDKs.

This page shows exactly how to connect and run inference on Huddle01.

Connection details

  • Base URL: https://gru.huddle01.io/v1
  • API key header: Authorization: Bearer <HUDDLE_API_KEY>
  • Content type: application/json

OpenAPI-style spec

openapi: 3.0.3
info:
  title: Huddle01 AI Inference API
  version: "1.0.0"
servers:
  - url: https://gru.huddle01.io/v1
paths:
  /chat/completions:
    post:
      summary: Generate model response from chat messages
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [model, messages]
              properties:
                model:
                  type: string
                  example: gpt-4o-mini
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum: [system, user, assistant]
                      content:
                        type: string
      responses:
        "200":
          description: Successful inference response
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

cURL example

curl -X POST "https://gru.huddle01.io/v1/chat/completions" \
  -H "Authorization: Bearer $HUDDLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      { "role": "system", "content": "You are a concise assistant." },
      { "role": "user", "content": "Explain inference in one paragraph." }
    ]
  }'

Python (OpenAI SDK compatible)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_HUDDLE_API_KEY",
    base_url="https://gru.huddle01.io/v1",
)

resp = client.chat.completions.create(
    model="claude-sonnet-4",
    messages=[
        {"role": "user", "content": "Write a short release note for a new AI API."}
    ],
)

print(resp.choices[0].message.content)

JavaScript (OpenAI SDK compatible)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.HUDDLE_API_KEY,
  baseURL: "https://gru.huddle01.io/v1",
});

const response = await client.chat.completions.create({
  model: "deepseek-chat",
  messages: [{ role: "user", content: "Give me 3 product tagline options." }],
});

console.log(response.choices[0].message?.content);

Model switching example

Inference routing is model-driven. Keep the same code, change only model.

{ "model": "gpt-4o-mini" }
{ "model": "claude-sonnet-4" }
{ "model": "gemini-2.5-flash" }
{ "model": "deepseek-r1" }

What “supported” means

  • Text/Chat: standard chat completion use cases.
  • Code: generation and code transformation tasks.
  • Reasoning: strong multi-step problem solving.
  • Vision: multimodal image + text support where available.