Stack 3.0 API v1

Public Beta — Free to use

Stack 3.0 API

Build AI-powered applications with Stack 3.0. OpenAI-compatible endpoint, 1,000 free requests/day, zero setup required.

Quickstart

1. Get an API Key

Sign up at stack-ai.me/signup, then go to API Keys to generate your key.

2. Make Your First Request

curl https://www.stack-ai.me/api/v1/chat \
  -H "Authorization: Bearer sk_stk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Hello, who are you?"}
    ]
  }'

3. That's It!

The API responds instantly using Groq's infrastructure — no server setup, no GPU costs.

Authentication

All API requests require your secret key in the Authorization header.

Authorization: Bearer sk_stk_your_api_key_here

⚠️ Keep your key secret: Do not share your API key in public repositories, client-side code, or screenshots. If compromised, revoke it immediately from your dashboard.

Chat Completions

OpenAI-compatible chat endpoint. Send a conversation and receive an AI response.

POST/api/v1/chat

Request Body

ParameterTypeDescription
messages*arrayArray of message objects with role and content
messages[].role*string"system", "user", or "assistant"
messages[].content*stringThe message text
modelstringModel to use (defaults to llama-3.1-8b-instant)

Example Request

const response = await fetch('https://www.stack-ai.me/api/v1/chat', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_stk_your_api_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    messages: [
      { role: 'system', content: 'You are a helpful coding assistant.' },
      { role: 'user', content: 'Write a Python function to fibonacci.' }
    ]
  })
});

const data = await response.json();
console.log(data.choices[0].message.content);

Response

{
  "id": "chatcmpl_1713542400",
  "object": "chat.completion",
  "created": 1713542400,
  "model": "llama-3.1-8b-instant",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Here is a Python fibonacci function..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 128,
    "total_tokens": 170
  }
}

Rate Limits

1,000 / day
Daily Requests
per API key
00:00 UTC
Reset Time
daily
~200ms
Response Time
median latency

Rate limits are per API key. Upgrade to Pro for higher limits (coming soon).

Error Codes

401
authentication_error

Missing or invalid API key

429
rate_limit_exceeded

Daily request limit reached

400
invalid_request_error

Malformed request body

500
internal_error

Server error — try again

Python Example

import requests

API_KEY = "sk_stk_your_api_key_here"
BASE_URL = "https://www.stack-ai.me/api/v1"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json",
}

response = requests.post(
    f"{BASE_URL}/chat",
    headers=headers,
    json={
        "messages": [
            {"role": "user", "content": "Explain async/await in JavaScript"}
        ]
    }
)

data = response.json()
print(data["choices"][0]["message"]["content"])

Ready to build?

Get your API key and start integrating in minutes.