Logotip de SHANNON A.I.
SHANNON A.I.
Xat Preus API Recerca Empresa Pentest AI Startup Boost
Inicia sessió
Pla i Ús
Xat Preus API Recerca Empresa Pentest AI Startup Boost Inicia sessió Pla i Ús

Tria el teu idioma

Tots els idiomes són iguals. Tria el que vols utilitzar.

Documentació de l'API

Shannon API

API d'IA compatible amb OpenAI i Anthropic amb crida de funcions, cerca web i sortides estructurades.

Obtén la teva clau API Prova el Playground V2
Documentació
  • OV Visió general
  • CP Capacitats
  • QS Inici ràpid
  • PG Playground de l’API Nou
  • AU Autenticació
  • ML Models
  • FN Crida de funcions
  • JS Sortides estructurades
  • SS Streaming
  • WS Cerca web
  • AN Anthropic
  • SD SDKs
  • ER Gestió d’errors
  • CL Registre de canvis
  • AK La teva clau API
  • US El teu ús

Shannon AI API Documentation

Visió general

Documentacio publica

Tot el que necessites per publicar amb l'API compatible d'OpenAI i Anthropic de Shannon.

URL base Compatible amb OpenAI
https://api.shannon-ai.com/v1/chat/completions

Utilitza l'API de Chat Completions amb crida de funcions i streaming.

URL base Compatible amb Anthropic
https://api.shannon-ai.com/v1/messages

Format Claude Messages amb eines i capcalera anthropic-version.

Capcaleres Autenticació
Authorization: Bearer <api-key>

O X-API-Key amb anthropic-version per a crides estil Claude.

Acces Estat
Documentacio publica - Cal una clau per fer crides

Streaming, crida de funcions, sortides estructurades, cerca web.

Llista de verificacio de llancament
  • +
    Apunta el teu SDK a Shannon
    Estableix baseURL als endpoints OpenAI o Anthropic anteriors.
    Configuracio
  • +
    Afegeix la teva clau API
    Utilitza tokens Bearer per a crides OpenAI o X-API-Key + anthropic-version.
    Seguretat
  • +
    Activa eines i sortides estructurades
    Admet eines/funcions OpenAI, esquema JSON i web_search integrat.
    Capacitats
  • +
    Controla l'us
    Consulta el consum de tokens i cerques en aquesta pagina quan hagis iniciat sessio al teu compte.
    Analitica

Capacitats

OpenAI + Anthropic

Substitut directe d'OpenAI i Anthropic amb suport nadiu per a eines, sortides estructurades i cerca web integrada.

AI

Substitució drop‑in

Compatible

Funciona amb els SDK d’OpenAI i Anthropic. Només canvia l’URL base.

AI

Crida de funcions

Eines

Defineix eines, deixa que Shannon les cridi. Admet modes auto, forced i none.

AI

Cerca web integrada

Cerca

Cerca web en temps real amb citacions de fonts. Disponible automàticament.

AI

Sortides estructurades

JSON

Mode JSON i aplicació d’JSON Schema per a una extracció de dades fiable.

AI

Eines multivolta

Agent

Bucles d’execució automàtica de funcions. Fins a 10 iteracions per sol·licitud.

AI

Streaming

Ràpid

Server‑sent events per al streaming de tokens en temps real.

Inici ràpid

5 minuts

Comença en tres passos. Shannon imita els clients d’OpenAI i Anthropic.

1

Defineix l’URL base

Utilitza l’endpoint compatible amb OpenAI.

https://api.shannon-ai.com/v1/chat/completions
2

Afegeix la teva clau API

Utilitza autenticació Bearer a la capçalera Authorization.

3

Envia el teu primer missatge

Tria una llengua i substitueix‑hi la teva clau.

Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/v1"
)

response = client.chat.completions.create(
    model="shannon-1.6-lite",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello, Shannon!"}
    ],
    max_tokens=1024
)

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

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/v1'
});

const response = await client.chat.completions.create({
  model: 'shannon-1.6-lite',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Hello, Shannon!' }
  ],
  max_tokens: 1024
});

console.log(response.choices[0].message.content);
Go
package main

import (
    "context"
    "fmt"
    openai "github.com/sashabaranov/go-openai"
)

func main() {
    config := openai.DefaultConfig("YOUR_API_KEY")
    config.BaseURL = "https://api.shannon-ai.com/v1"
    client := openai.NewClientWithConfig(config)

    resp, err := client.CreateChatCompletion(
        context.Background(),
        openai.ChatCompletionRequest{
            Model: "shannon-1.6-lite",
            Messages: []openai.ChatCompletionMessage{
                {Role: "system", Content: "You are a helpful assistant."},
                {Role: "user", Content: "Hello, Shannon!"},
            },
            MaxTokens: 1024,
        },
    )
    if err != nil {
        panic(err)
    }
    fmt.Println(resp.Choices[0].Message.Content)
}
cURL
curl -X POST "https://api.shannon-ai.com/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "shannon-1.6-lite",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello, Shannon!"}
    ],
    "max_tokens": 1024
  }'

Format de resposta

Resposta d’èxit
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "Shannon 1.6 Lite",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm Shannon, your AI assistant. How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 18,
    "total_tokens": 43
  }
}

Playground de l’API

Nou

Prova l’API de Shannon directament al navegador. Crea la sol·licitud, executa‑la i veu la resposta en temps real.

1

Chat, Responses, Messages

Switch across OpenAI Chat Completions, Responses, and Anthropic Messages without leaving the playground.

2

Stream live output

Run real requests, inspect raw JSON, and view stream events from the same operator console.

3

Reuse your key

Signed-in users can pull their Shannon API key straight into the dedicated playground workspace.

/ca/docs/playground

The playground now lives on its own route so the API docs stay Astro-rendered while the request builder remains an explicitly interactive client tool.

Prova el Playground V2 Obtén la teva clau API

Autenticació

Totes les sol·licituds API requereixen autenticació amb la teva clau API de Shannon.

Format OpenAI (Recomanat)

HTTP
Authorization: Bearer YOUR_API_KEY

Anthropic

HTTP
X-API-Key: YOUR_API_KEY
anthropic-version: 2023-06-01

Models

Shannon ofereix diversos models optimitzats per a diferents casos d'ús.

AI
shannon-1.6-lite Shannon 1.6 Lite

Respostes rapides i eficients per a tasques quotidianes

Context 128K
Ideal per a Xat, Q&A, generacio de contingut
AI
shannon-1.6-pro Shannon 1.6 Pro

Raonament avancat per a problemes complexos

Context 128K
Ideal per a Analisi, recerca, tasques complexes
AI
shannon-2-lite Shannon 2 Lite

Context 128K
Ideal per a
AI
shannon-2-pro Shannon 2 Pro

Context 128K
Ideal per a
AI
shannon-coder-1 Shannon Coder

Optimitzat per a Claude Code CLI amb quota per crides

Context 128K
Ideal per a Generacio de codi, us d'eines, integracio CLI
Quota per crides

Crida de funcions

Defineix eines que Shannon pot cridar per executar accions o recuperar informació.

Python
from openai import OpenAI
import json

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/v1"
)

# Define available tools/functions
tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get current weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "City name, e.g., 'Tokyo'"
                    },
                    "unit": {
                        "type": "string",
                        "enum": ["celsius", "fahrenheit"]
                    }
                },
                "required": ["location"]
            }
        }
    }
]

response = client.chat.completions.create(
    model="shannon-1.6-lite",
    messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
    tools=tools,
    tool_choice="auto"
)

# Check if model wants to call a function
if response.choices[0].message.tool_calls:
    tool_call = response.choices[0].message.tool_calls[0]
    print(f"Function: {tool_call.function.name}")
    print(f"Arguments: {tool_call.function.arguments}")
JavaScript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/v1'
});

const tools = [
  {
    type: 'function',
    function: {
      name: 'get_weather',
      description: 'Get current weather for a location',
      parameters: {
        type: 'object',
        properties: {
          location: { type: 'string', description: "City name" },
          unit: { type: 'string', enum: ['celsius', 'fahrenheit'] }
        },
        required: ['location']
      }
    }
  }
];

const response = await client.chat.completions.create({
  model: 'shannon-1.6-lite',
  messages: [{ role: 'user', content: "What's the weather in Tokyo?" }],
  tools,
  tool_choice: 'auto'
});

if (response.choices[0].message.tool_calls) {
  const toolCall = response.choices[0].message.tool_calls[0];
  console.log('Function:', toolCall.function.name);
  console.log('Arguments:', toolCall.function.arguments);
}

Opcions de seleccio d'eines

"auto" El model decideix si cridar una funcio (per defecte)
"none" Desactiva la crida de funcions per a aquesta sollicitud
{"type": "function", "function": {"name": "..."}} Forca una crida de funcio especifica

Resposta de crida de funcio

Quan el model crida una funcio
{
  "id": "chatcmpl-xyz",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "tool_calls": [
          {
            "id": "call_abc123",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"location\": \"Tokyo\", \"unit\": \"celsius\"}"
            }
          }
        ]
      },
      "finish_reason": "tool_calls"
    }
  ]
}

Sortides estructurades

Força Shannon a respondre amb JSON vàlid que coincideixi amb el teu esquema.

Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/v1"
)

# Force JSON output with schema
response = client.chat.completions.create(
    model="shannon-1.6-lite",
    messages=[
        {"role": "user", "content": "Extract: John Doe, 30 years old, engineer"}
    ],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "person_info",
            "schema": {
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "age": {"type": "integer"},
                    "occupation": {"type": "string"}
                },
                "required": ["name", "age", "occupation"]
            }
        }
    }
)

import json
data = json.loads(response.choices[0].message.content)
print(data)  # {"name": "John Doe", "age": 30, "occupation": "engineer"}
JavaScript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/v1'
});

const response = await client.chat.completions.create({
  model: 'shannon-1.6-lite',
  messages: [
    { role: 'user', content: 'Extract: John Doe, 30 years old, engineer' }
  ],
  response_format: {
    type: 'json_schema',
    json_schema: {
      name: 'person_info',
      schema: {
        type: 'object',
        properties: {
          name: { type: 'string' },
          age: { type: 'integer' },
          occupation: { type: 'string' }
        },
        required: ['name', 'age', 'occupation']
      }
    }
  }
});

const data = JSON.parse(response.choices[0].message.content);
console.log(data); // { name: "John Doe", age: 30, occupation: "engineer" }

Opcions de format de resposta

{"type": "json_object"} Forca una sortida JSON valida (sense esquema especific)
{"type": "json_schema", "json_schema": {...}} Forca una sortida que coincideixi amb el teu esquema exacte

Streaming

Activa l'streaming de tokens en temps real amb Server‑Sent Events per a UI responsives.

Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/v1"
)

# Enable streaming for real-time responses
stream = client.chat.completions.create(
    model="shannon-1.6-lite",
    messages=[
        {"role": "user", "content": "Write a short poem about AI"}
    ],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
JavaScript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/v1'
});

// Enable streaming for real-time responses
const stream = await client.chat.completions.create({
  model: 'shannon-1.6-lite',
  messages: [
    { role: 'user', content: 'Write a short poem about AI' }
  ],
  stream: true
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}
Consell: Les respostes en streaming arriben com a Server-Sent Events. Cada fragment conte un delta amb contingut parcial.

Cerca web

Shannon inclou una funció web_search integrada disponible automàticament.

Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/v1"
)

# Web search is automatically available!
# Shannon will use it when needed for current information

response = client.chat.completions.create(
    model="shannon-1.6-lite",
    messages=[
        {"role": "user", "content": "What are the latest AI news today?"}
    ],
    # Optionally, explicitly define web_search tool
    tools=[{
        "type": "function",
        "function": {
            "name": "web_search",
            "description": "Search the web for current information",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "Search query"}
                },
                "required": ["query"]
            }
        }
    }]
)

print(response.choices[0].message.content)
# Response includes sources and citations
JavaScript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/v1'
});

// Web search is automatically available!
// Shannon will use it when needed for current information

const response = await client.chat.completions.create({
  model: 'shannon-1.6-lite',
  messages: [
    { role: 'user', content: 'What are the latest AI news today?' }
  ],
  // Optionally, explicitly define web_search tool
  tools: [{
    type: 'function',
    function: {
      name: 'web_search',
      description: 'Search the web for current information',
      parameters: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search query' }
        },
        required: ['query']
      }
    }
  }]
});

console.log(response.choices[0].message.content);
// Response includes sources and citations
Consell pro: Els resultats de cerca web inclouen cites. Shannon citara les fonts automaticament.

Anthropic

Shannon també admet el format Messages API d'Anthropic.

https://api.shannon-ai.com/v1/messages
Python
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://api.shannon-ai.com/messages"
)

response = client.messages.create(
    model="shannon-1.6-lite",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Shannon!"}
    ],
    # Tool use (Anthropic format)
    tools=[{
        "name": "web_search",
        "description": "Search the web",
        "input_schema": {
            "type": "object",
            "properties": {
                "query": {"type": "string"}
            },
            "required": ["query"]
        }
    }]
)

print(response.content[0].text)
JavaScript
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.shannon-ai.com/messages'
});

const response = await client.messages.create({
  model: 'shannon-1.6-lite',
  max_tokens: 1024,
  messages: [
    { role: 'user', content: 'Hello, Shannon!' }
  ],
  // Tool use (Anthropic format)
  tools: [{
    name: 'web_search',
    description: 'Search the web',
    input_schema: {
      type: 'object',
      properties: {
        query: { type: 'string' }
      },
      required: ['query']
    }
  }]
});

console.log(response.content[0].text);
Capcalera obligatoria: El format Anthropic requereix anthropic-version: 2023-06-01.

SDKs

Compatible

Fes servir qualsevol SDK d'OpenAI o Anthropic — només canvia la URL base.

OpenAI-Compatible SDKs

SDK Python

SDK oficial d'OpenAI per a Python - funciona amb Shannon

pip install openai
Veure documentacio ->
SDK JavaScript / TypeScript

SDK oficial d'OpenAI per a Node.js - funciona amb Shannon

npm install openai
Veure documentacio ->
SDK Go

Client Go de la comunitat per a APIs compatibles amb OpenAI

go get github.com/sashabaranov/go-openai
Veure documentacio ->
SDK Ruby

Client Ruby de la comunitat per a APIs compatibles amb OpenAI

gem install ruby-openai
Veure documentacio ->
SDK PHP

Client PHP de la comunitat per a APIs compatibles amb OpenAI

composer require openai-php/client
Veure documentacio ->
SDK Rust

Client Rust asincron per a APIs compatibles amb OpenAI

cargo add async-openai
Veure documentacio ->

Anthropic-Compatible SDKs

SDK Python (Anthropic)

SDK oficial d'Anthropic per a Python - funciona amb Shannon

pip install anthropic
Veure documentacio ->
SDK TypeScript (Anthropic)

SDK oficial d'Anthropic per a TypeScript - funciona amb Shannon

npm install @anthropic-ai/sdk
Veure documentacio ->

Gestió d’errors

Shannon utilitza codis d’estat HTTP estàndard i retorna missatges d’error detallats.

400 Sol·licitud incorrecta Format de sol·licitud o paràmetres no vàlids
401 No autoritzat Clau API no vàlida o absent
402 Quota excedida S’ha excedit la quota de tokens o de cerca
429 Limitació de ritme Massa sol·licituds, redueix la velocitat
500 Error del servidor Error intern, torna-ho a provar més tard

Format de resposta d’error

Resposta d’error
{
  "error": {
    "message": "Invalid API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

Registre de canvis

LOG

Actualitzacions i millores recents de la Shannon API.

v2.1.0
2025-01-03
  • Nou Afegit el model shannon-coder-1 per a la integracio amb Claude Code CLI
  • Nou Sistema de quota per crides per al model Coder
  • Millorat Fiabilitat de crida de funcions millorada
v2.0.0
2024-12-15
  • Nou Afegida compatibilitat amb l'API Messages d'Anthropic
  • Nou Execucio d'eines en multip torns (fins a 10 iteracions)
  • Nou Suport del format de resposta JSON Schema
  • Millorat Cerca web millorada amb cites de mes qualitat
v1.5.0
2024-11-20
  • Nou Afegit el model shannon-deep-dapo per a raonament complex
  • Nou Funcio web_search integrada
  • Millorat Latencia reduida en respostes en streaming
v1.0.0
2024-10-01
  • Nou Llançament inicial de l'API
  • Nou Endpoint de chat completions compatible amb OpenAI
  • Nou Suport de crida de funcions
  • Nou Streaming mitjancant Server-Sent Events

La teva clau API

Acces
Utilitza tokens Bearer per a crides OpenAI o X-API-Key + anthropic-version.
YOUR_API_KEY
Obtén la teva clau API

Mantén la clau API en secret. Regenerar crea una clau nova i invalida l’antiga.

Versió: 1
Última rotació: Mai
Últim ús: Mai

El teu ús

Consulta el consum de tokens i cerques en aquesta pagina quan hagis iniciat sessio al teu compte.

-- Trucades d’API
-- Tokens utilitzats

Shannon Coder (shannon-coder-1)

Quota basada en trucades per a Shannon Coder (shannon-coder-1). Es reinicia cada 4 hores.

0 Trucades utilitzades
0 Trucades restants

Preparat per construir?

Obtén la teva clau API i comença a construir amb Shannon AI avui.

Crea una clau API Veure docs

Cerques populars:

Prova amb altres paraules clau
Navega: ↑ ↓ Selecciona: Enter Tanca: Esc