Alphakek AI
WebsiteTwitterTelegramDiscordBlog
  • Introduction
  • AIKEK Network
  • Case Studies
  • Tokenomics
  • Roadmap
  • RESEARCH
    • Fractal
    • DeFAI Terminal
      • Chat Summary
      • Wallet Finder
      • Token Audit
      • Sentiment Analysis
      • AI News Search
    • Onchain Analysis
  • CREATE
    • Meme Generator
      • Text-to-Image
      • Effect
      • Mirage
      • Caption Meme
      • Text-to-Video
    • Meme Models
    • Prompt Enhancer
  • Launch
    • AI Agents
      • Agent Swarm
    • Universal Agents
    • Knowledge Swarms
    • NFT Art Generation
  • DEVELOPERS
    • Enterprise API
      • Memelord API
      • Wizard API
      • Alpha Alerts API
    • API Pricing
    • Changelog
  • GUIDES
    • Bot Commands
    • User Tiers
    • Bridging to Base
    • Bridging to Solana
    • API Usage Examples
    • AIKEK vs. ChatGPT
    • AIKEK vs. Stability AI
  • LEGAL
    • Privacy Policy
    • Token Disclosure
  • LINKS
    • Team
    • DexScreener
    • Twitter
    • Telegram
    • Website
    • Discord
    • Warpcast
    • Blog
    • Email
Powered by GitBook
On this page
  1. DEVELOPERS
  2. Enterprise API

Wizard API

Integrate AI chat in your product.

PreviousMemelord APINextAlpha Alerts API

Last updated 2 months ago

Chat API has been deprecated in favor of the , our new method of delivering our Universal Agents and Fractal data infra to B2B.

The API endpoint for DeFAI Terminal is compatible with OpenAI's and can be used as a drop-in replacement by changing three lines of code:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_TOKEN_HERE",  # Replace OpenAI's token with AlphaKEK's
    base_url="https://api.alphakek.ai/v1"  # Switch to Alpha API server
)

response = client.chat.completions.create(
  model="nexus",  # Switch to Nexus model with crypto knowledge
  messages=[
    {"role": "user", "content": "What to expect from Ethereum ETFs?"}
  ]
)
import OpenAI from 'openai';

const client = new OpenAI({
    apiKey: "YOUR_TOKEN_HERE", // Replace OpenAI's token with AlphaKEK's
    baseURL: 'https://api.alphakek.ai/v1' // Switch to Alpha API server
});

const response = await client.chat.completions.create({
    model: "nexus", // Switch to Nexus model with crypto knowledge
    messages: [{
        "role": "user",
        "content": "What to expect from Ethereum ETFs?"
    }]
});

Available models: versa, nexus, eclipse. Refer to Universal Agents for the detailed comparison of each model. The pricing information is available at .


JSON Schema

To enable JSON-constrained generation, pass json_schema argument to the extra_body field:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.alphakek.ai/v1"
)
messages = [
    {
        "role": "user",
        "content": "Write 5 tweets about crypto ETF news in a JSON format."
    },
]

response = client.chat.completions.create(
    model='nexus',
    messages=messages,
    extra_body={
        'json_schema': {
            "$schema": "http://json-schema.org/draft-07/schema#",
            "type": "object",
            "properties": {
                "tweet1": {
                    "type": "string"
                },
                "tweet2": {
                    "type": "string"
                },
                "tweet3": {
                    "type": "string"
                },
                "tweet4": {
                    "type": "string"
                },
                "tweet5": {
                    "type": "string"
                }
            },
            "required": [
                "tweet1",
                "tweet2",
                "tweet3",
                "tweet4",
                "tweet5"
            ]
        }
    }
)

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

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

const question = "Write 5 tweets about crypto ETF news in a JSON format.";
console.log("Question:", question);

try {
    const response = await client.chat.completions.create({
            model: "nexus",
            messages: [{
                role: 'user',
                content: question
            }],
            json_schema: {
                "$schema": "http://json-schema.org/draft-07/schema#",
                "type": "object",
                "properties": {
                    "tweet1": {
                        "type": "string"
                    },
                    "tweet2": {
                        "type": "string"
                    },
                    "tweet3": {
                        "type": "string"
                    },
                    "tweet4": {
                        "type": "string"
                    },
                    "tweet5": {
                        "type": "string"
                    }
                },
                "required": [
                    "tweet1",
                    "tweet2",
                    "tweet3",
                    "tweet4",
                    "tweet5"
                ]
            }
        },
    );
    const response_text = response.choices[0].message.content;
    console.log("Response:\n", response_text);

} catch (error) {
    console.error('Error handling:', error);
}

Sample output:

```json
[
    {
        "text": "🚀 #Ethereum #ETFs expected to attract $15B in investments within 18 months of launch. First ETFs predicted to drop this summer. Time to load up the bags! #Crypto #ETH"
    },
    {
        "text": "#VanEck files for a spot #Solana ETF, sending $SOL surging over 6%. Will this be the next big thing after their successful $BTC and $ETH ETFs? Place your bets! 🤑 #Crypto"
    },
    {
        "text": "The battle of the #SmartContract platforms: While $SOL surges on ETF news, analysts predict slower but steadier growth for $AVAX. Which horse are you backing? #CryptoBets"
    },
    {
        "text": "#Ethereum #ETF launch might be postponed until after July 4th due to paperwork issues. Don't worry, it's still coming! Time to stack more $ETH while it's still cheap! 💰 #BuyTheDip"
    },
    {
        "text": "#21Shares joins the race to launch a #Solana ETF. Will this be the first spot $SOL ETF? Let's goooooo! 🚀 #CryptoNews"
    }
]
```

Limitations

  • Function calling is not supported (except for the functions of Alpha Alerts API that are being called automatically by nexus and eclipse models.

This list of limitations is subject to change.


Chat API Costs

The pricing for Chat API is per request and depends on the model used. Learn more about API Credits at API Pricing.

Model
API Credits per request

Versa

1

Nexus

2

Eclipse

3

API Usage Examples
  • POSTChat Completions
  • JSON Schema
  • Limitations
  • Chat API Costs
Chat Completion API

Chat Completions

post
Authorizations
Header parameters
turnstile-authorizationany ofOptional
stringOptional
or
nullOptional
Body
modelstring · enumRequiredPossible values:
streambooleanOptionalDefault: false
personaany ofOptional
stringOptional
or
nullOptional
json_schemaany ofOptional
objectOptional
or
nullOptional
temperaturenumberOptionalDefault: 0.7
top_pany ofOptionalDefault: 0.95
numberOptional
or
nullOptional
frequency_penaltyany ofOptionalDefault: 1.17
numberOptional
or
nullOptional
top_kany ofOptionalDefault: 50
integerOptional
or
nullOptional
Responses
200
Successful Response
Responseany of
or
stringOptional
or
422
Validation Error
application/json
post
POST /v1/chat/completions HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 171

{
  "model": "versa",
  "messages": [
    {
      "role": "system",
      "content": "text"
    }
  ],
  "stream": true,
  "persona": "text",
  "json_schema": {},
  "temperature": 1,
  "top_p": 1,
  "frequency_penalty": 1,
  "top_k": 1
}
{
  "id": "text",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 1,
      "logprobs": {
        "content": [
          {
            "token": "text",
            "bytes": [
              1
            ],
            "logprob": 1,
            "top_logprobs": [
              {
                "token": "text",
                "bytes": [
                  1
                ],
                "logprob": 1,
                "ANY_ADDITIONAL_PROPERTY": "anything"
              }
            ],
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        ],
        "refusal": [
          {
            "token": "text",
            "bytes": [
              1
            ],
            "logprob": 1,
            "top_logprobs": [
              {
                "token": "text",
                "bytes": [
                  1
                ],
                "logprob": 1,
                "ANY_ADDITIONAL_PROPERTY": "anything"
              }
            ],
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        ],
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "message": {
        "content": "text",
        "refusal": "text",
        "role": "assistant",
        "annotations": [
          {
            "type": "url_citation",
            "url_citation": {
              "end_index": 1,
              "start_index": 1,
              "title": "text",
              "url": "text",
              "ANY_ADDITIONAL_PROPERTY": "anything"
            },
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        ],
        "audio": {
          "id": "text",
          "data": "text",
          "expires_at": 1,
          "transcript": "text",
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "function_call": {
          "arguments": "text",
          "name": "text",
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "tool_calls": [
          {
            "id": "text",
            "function": {
              "arguments": "text",
              "name": "text",
              "ANY_ADDITIONAL_PROPERTY": "anything"
            },
            "type": "function",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        ],
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "created": 1,
  "model": "text",
  "object": "chat.completion",
  "service_tier": "auto",
  "system_fingerprint": "text",
  "usage": {
    "completion_tokens": 1,
    "prompt_tokens": 1,
    "total_tokens": 1,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 1,
      "audio_tokens": 1,
      "reasoning_tokens": 1,
      "rejected_prediction_tokens": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "prompt_tokens_details": {
      "audio_tokens": 1,
      "cached_tokens": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
#api-costs
🧙🏻‍♂️ AIKEK Wizard