The official documentation for the DynaSpark API - Your free AI generation platform
Try API | Try DynaSpark AI | Documentation | Python Client | Report Issues
- Overview
- Quick Start
- Authentication
- Endpoints
- Response Formats
- Error Handling
- Rate Limits
- Examples
- API Status
- Support
- Python Client
DynaSpark is a powerful AI generation platform that provides easy access to various AI models for text, image, and audio generation. The API is designed to be simple to use while offering advanced features for developers.
- π€ Multiple AI models for text generation
- π¨ High-quality image generation with customization options
- π Natural-sounding audio responses
- π Simple authentication system
- π Comprehensive rate limiting
- π Fast and reliable API endpoints
- Base URL:
https://dynaspark.onrender.com/api
- Authentication: Currently, no API key is required
- Example Request:
curl "https://dynaspark.onrender.com/api/generate_response?user_input=Hello%20world"
The API uses a simple API key authentication system. Include your API key in the request parameters:
?api_key=YOUR_API_KEY
Note: Currently, no API key is required for testing and development. You can use the API without authentication.
Generate text responses using various models and parameters.
Endpoint: /generate_response
Method: GET
Parameter | Type | Description | Default |
---|---|---|---|
user_input |
string | The input text to generate a response for | Required |
api_key |
string | Your API key | Required |
model |
string | Model to use for generation | None |
temperature |
float | Controls randomness (0.0-3.0) | None |
top_p |
float | Controls diversity (0.0-1.0) | None |
presence_penalty |
float | Penalizes repeated tokens (-2.0-2.0) | None |
frequency_penalty |
float | Penalizes frequent tokens (-2.0-2.0) | None |
json |
boolean | Return JSON response | false |
system |
string | Custom system prompt | None |
stream |
boolean | Stream the response | false |
private |
boolean | Keep generation private | false |
seed |
integer | Random seed for reproducibility | None |
referrer |
string | Referrer information | None |
voice |
string | Voice for audio response | None |
curl "https://dynaspark.onrender.com/api/generate_response?user_input=What%20is%20AI%3F&temperature=0.8"
{
"response": "Artificial Intelligence (AI) is a branch of computer science...",
"model": "default",
"usage": {
"prompt_tokens": 4,
"completion_tokens": 150,
"total_tokens": 154
}
}
Generate images from text descriptions with various customization options.
Endpoint: /generate_image
Method: GET
Parameter | Type | Description | Default |
---|---|---|---|
user_input |
string | The prompt to generate an image for | Required |
api_key |
string | Your API key | Required |
width |
integer | Image width (64-2048) | 768 |
height |
integer | Image height (64-2048) | 768 |
model |
string | Model to use (flux/turbo/gptimage) | None |
nologo |
boolean | Exclude watermark | false |
seed |
integer | Random seed | None |
wm |
string | Custom watermark | None |
curl "https://dynaspark.onrender.com/api/generate_image?user_input=A%20beautiful%20sunset&width=1024&height=768"
{
"image_url": "https://dynaspark.onrender.com/generated/image_123456.png",
"model": "flux",
"seed": 12345
}
Generate natural-sounding audio responses using text generation with audio output.
Endpoint: /generate_response
Method: GET
Parameter | Type | Description | Default |
---|---|---|---|
user_input |
string | The input text to generate a response for | Required |
api_key |
string | Your API key | Required |
model |
string | Must be "openai-audio" | Required |
voice |
string | Voice to use | "alloy" |
Voice | Description |
---|---|
alloy |
Balanced, natural-sounding voice (default) |
echo |
Clear, professional voice |
fable |
Warm, engaging voice |
onyx |
Deep, authoritative voice |
nova |
Bright, energetic voice |
shimmer |
Soft, melodic voice |
curl "https://dynaspark.onrender.com/api/generate_response?user_input=Hello%20world&model=openai-audio&voice=nova" \
--output response.mp3
- Binary audio data (MP3 format)
- Content-Type: audio/mpeg
- Default: JSON object with
response
field - With
json=true
: Full JSON response with metadata - With
stream=true
: Server-sent events stream
- JSON object with
image_url
field - Image URL is valid for 24 hours
- Binary MP3 data
- Content-Type: audio/mpeg
The API uses standard HTTP status codes and returns error messages in JSON format:
{
"error": "Error message description"
}
Code | Description |
---|---|
400 |
Bad Request (invalid parameters) |
401 |
Unauthorized (invalid API key) |
429 |
Too Many Requests (rate limit exceeded) |
500 |
Internal Server Error |
- Free API Key: 100 requests per hour
- Custom API Keys: Contact for limits
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1625097600
curl "https://dynaspark.onrender.com/api/generate_response?user_input=Write%20a%20poem&temperature=0.8&top_p=0.9&presence_penalty=0.6&frequency_penalty=0.6"
curl "https://dynaspark.onrender.com/api/generate_image?user_input=A%20futuristic%20city&width=1024&height=768&model=flux&nologo=true"
curl "https://dynaspark.onrender.com/api/generate_response?user_input=Hello%20world&model=openai-audio&voice=nova" \
--output response.mp3
curl "https://dynaspark.onrender.com/api/generate_response?user_input=List%203%20colors&json=true"
Check the API status at: https://dynaspark.onrender.com/status
For API support, feature requests, or bug reports:
- GitHub Issues: https://github.com/Th3-AI/DynaSpark/issues
- Email: dvp.ai.ml@gmail.com
For a more convenient way to use the DynaSpark API in Python, check out our official Python client:
The Python client provides:
- π Simple Python interface
- π¦ Easy installation via pip
- π― Full API support
- π§ Type hints and IDE integration
- π‘οΈ Built-in error handling
Quick example:
from dynaspark import DynaSpark
# Initialize client (no API key required)
client = DynaSpark()
# Generate text
response = client.generate_text("Hello, world!")
print(response.text)
View Python Client Documentation β
Made with β€οΈ by Th3-C0der