Generate
Generate Endpoints
These endpoints accept inputs and return generated content based on the chosen model. The server handles the heavy lifting (e.g., calling GPT, DALL·E, or other LLM/image models) and returns a simple JSON response.
Generation Endpoint
This endpoint combines text and image generation into a single streamlined request. Instead of using separate endpoints for text and image generation, the items are generated concurrently and automatically create a generation record. The endpoint calls the appropriate AI models and returns a JSON response containing the generated content along with the record ID.
Endpoint URL:
https://api.aiis.dev/v2/generations/generate
Request Payload: The endpoint expects a JSON payload with the following fields:
name (string): The token name.
prompt (string): The prompt for image generation.
symbol (string): The token symbol.
supply (string): The token supply.
namePrompt (string): Prompt for generating a token name.
symbolPrompt (string): Prompt for generating a token symbol.
supplyPrompt (string): Prompt for generating a token supply description.
temperature (number): Required for most text generation models.
textModel (string): Specifies which text generation model to use. Options include:
GPT-3.5 (use "GPT-3.5")
GPT-4 (use "GPT-4")
Claude
Gemini
Llama
Bittensor
AstroPepeX
model (string): Specifies the image generation model to use. Options include:
DALLE-2 (use "DALLE-2")
DALLE-3 (use "DALLE-3")
Bittensor
Flux
CUSTOM
with_ai (boolean):
true: The endpoint applies additional AI-based enhancements to generate creative and refined outputs.
false: The endpoint bypasses AI generation and returns the provided prompt values as the output. This allows clients to use their own values without triggering extra processing.
How It Works:
Input Validation: The endpoint validates and casts the incoming request using a DTO.
API Keys & Context: It extracts the necessary API keys and configuration from the request context.
Model-Specific Generation:
Image Generation: The endpoint selects the appropriate function (e.g.,
genDalle2Image
,genDalle3Image
, etc.) based on themodel
parameter. This function produces an image URL and returns the final prompt used for generation.Text Generation: Based on the
textModel
parameter (and ensuring thattemperature
is provided when required), the corresponding function (e.g.,generateGPT3Text
,generateGPT4Text
, etc.) is invoked to generate text outputs such as the token name, supply, and symbol.
with_ai Parameter Behavior:
If with_ai is set to true, the endpoint calls the AI generation functions to produce enhanced, creative outputs.
If with_ai is set to false, the endpoint will bypass the AI generation step and simply return the input values provided in the payload. This allows for a deterministic or fallback behavior on the client side.
Record Creation: The endpoint automatically creates a new generation record on aiis.dev using the generated data.
Response: A JSON response is returned that includes the generation record ID, the generated image details, and text outputs.
Example Request:
Example Response:
List Generations:
https://api.aiis.dev/v2/generations/list
Returns a paginated list of shared generation records. Query parameters include:page: The page number.
pageSize: The number of records per page.
sortBy: Sorting criteria (e.g., "latest", "mostUpvoted", "deployed", "mcap", or "bumps").
tokensOnly: (Optional) If true, only generations with an associated token are returned.
chain: (Optional) Filter by blockchain network.
Example Request:
Example Response:
Get Generation by ID: Fetches detailed information for a single generation record by its unique ID.
Example Request:
Example Response:
──────────────────────────── Note: The separate text and image generation endpoints have been merged into the single Generation Endpoint, which both generates content and creates a corresponding record. This simplifies integration and ensures consistency across generation requests.
Response: A JSON response is returned that includes the generation record ID, the generated image details, and text outputs.
Example Request:
Example Response:
List Generations:
https://api.aiis.dev/v2/generations/list
Returns a paginated list of shared generation records. Query parameters include:
page: The page number.
pageSize: The number of records per page.
sortBy: Sorting criteria (e.g., "latest", "mostUpvoted", "deployed", "mcap", or "bumps").
tokensOnly: (Optional) If true, only generations with an associated token are returned.
chain: (Optional) Filter by blockchain network.
Example Request:
Example Response:
Get Generation by ID:
GET https://api.aiis.dev/v2/generations/:id
Fetches detailed information for a single generation record by its unique ID.
Example Request:
Example Response:
──────────────────────────── Note: The separate text and image generation endpoints have been merged into the single Generation Endpoint, which both generates content and creates a corresponding record. This simplifies integration and ensures consistency across generation requests.
Last updated