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:
```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.