Overview
The Segmind Logo Generation API generates a logo image by combining a prompt generation step with Segmind’s image generation capabilities. It first uses the existing Logo Prompt Generator to create a text prompt from a shop description and category, then submits this prompt to Segmind’s API to generate the logo. The process involves polling for the final image URL, making this tool ideal for businesses needing professional logos with a web3 focus.API Endpoint
- URL: This API involves multiple endpoints:
- Prompt Generation:
https://text-tad.droplinked.workers.dev/ - Segmind Workflow Submission:
https://api.segmind.com/workflows/67792adb99c1698a193130bb-v5 - Segmind Polling:
https://api.segmind.com/workflows/request/[request_id]
- Prompt Generation:
- Methods:
- Prompt Generation:
POST - Workflow Submission:
POST - Polling:
GET
- Prompt Generation:
- Content-Type:
application/json
Authentication
This API requires two API keys:- For Prompt Generation (via
text-tad.droplinked.workers.dev):- Header:
api-key - Value:
<YOUR_API_KEY>(provided by Droplinked).
- Header:
- For Segmind API (via
api.segmind.com):- Header:
x-api-key - Value:
<YOUR_SEGMIND_API_KEY>(your Segmind account API key).
- Header:
Request Format
The process involves three steps:Step 1: Generate Logo Prompt
This step uses the existing Logo Prompt Generator API to create a text prompt. Request Body
Example Request Body
A futuristic and innovative logo for Droplinked, offering web3 and on-chain solutions to businesses and individuals.).
Step 2: Submit to Segmind Workflow
Submit the generated prompt to Segmind’s API to start logo generation. Request Body
Example Request Body
Step 3: Poll for Final Image URL
Use thepoll_url from Step 2 to check the status and retrieve the final image URL.
Request
- Method:
GET - URL: The
poll_urlfrom the Step 2 response (e.g.,https://api.segmind.com/workflows/request/68fe486045f6afa20e521094f20192ab). - Headers: Include the Segmind API key (
x-api-key).
JavaScript Example
Below is an example of how to use the Segmind Logo Generation API in JavaScript with thefetch API:
Error Handling
- Prompt Generation Errors:
- Invalid API Key: Returns “Unauthorized”.
- Missing Fields: If
command_name,description, orcategoryis missing, an error may occur.
- Segmind Submission Errors:
- 401 Unauthorized: If the Segmind API key is invalid.
- 400 Bad Request: If
input_logoorinput_seedis missing.
- Polling Errors:
- 404 Not Found: If the
request_idis invalid. - 503 Service Unavailable: If Segmind is down.
- 404 Not Found: If the
Example Error Output (Segmind Submission)
Best Practices
- Description Detail: Provide a clear
descriptionandcategoryfor a relevant logo prompt. - Polling Interval: Implement a reasonable polling interval (e.g., 5-10 seconds) to avoid overloading the Segmind API.
- Error Handling: Handle transient failures by retrying the polling step with exponential backoff.
- Image Usage: Use the final image URL directly for display or download; ensure proper caching if needed.