Documentation
  • Quick Start
  • Models
    • Block Entropy Models
    • Block Entropy Image Generation
    • Avatars
    • Smart Routing
    • Routing through Openrouter
    • Block Entropy Embeddings
  • Generation
    • Chat Completions
    • Structured Generation
    • Image generation
      • Usage
      • API Reference
    • Text-to-speech
  • Guides
    • Open Web UI
    • Silly Tavern
      • Connecting to Silly Tavern
      • Story Image Generation
    • Danswers
  • Depreciations
Powered by GitBook
On this page

Quick Start

The Block Entropy API provides interfaces for developers to create intelligence layers in their applications.

The Block Entropy API provides interfaces for developers to create intelligence layers in their applications, powered by state-of-the-art, open source language, image, video, and audio models. The BE APIs use a format compatible with OpenAI, allowing developers to use the OpenAI SDK or software compatible with the OpenAI API to access these services.

Key Points:

  1. API Compatibility: By modifying the configuration, you can use OpenAI-compatible tools to access Block Entropy APIs.

  2. Base URLs:

    https://api.blockentropy.ai/v1

  3. API Keys: Services require API keys, which you must apply for and keep secure.

  4. Chat Completions: The API offers chat completion endpoints, which power conversational AI like ChatGPT and provide a way to generate text outputs based on input prompts.

  5. Streaming: The API supports streaming responses. Set the stream parameter to true to enable this feature.

Setup and Usage:

  1. Account Setup: Create an account and obtain an API key.

  2. Environment Setup:

    • Install Python

    • Set up a virtual environment (optional but recommended)

    • Install the appropriate OpenAI Python library

  3. API Key Configuration:

    • Set up the API key for all projects or for a single project

    • Keep the API key secure and do not share it

  4. Making API Requests:

    • Use curl, Python, Node.js, or other programming languages to send requests

Example Python Code:

# python3
# Install OpenAI SDK first: `pip3 install openai`
from openai import OpenAI

client = OpenAI(api_key="<blockentropy api key>", base_url="https://api.blockentropy.ai/v1")

response = client.chat.completions.create(
    model="be-405b-base-llama3.1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)

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

NextModels

Last updated 10 months ago