Code Generator
The Code Generator API helps you generate code and programming solutions using various AI models. This feature supports multiple AI models to provide comprehensive code generation capabilities for different programming languages and frameworks.
Overview
The Code Generator API allows you to:
- Generate code snippets and complete functions
- Get programming solutions and explanations
- Support multiple AI models for diverse coding approaches
- Generate code for various programming languages
- Enhance code generation with web search for additional context
Endpoint
Authentication
Field | Value |
---|---|
API-KEY | <api-key> |
Content-Type | application/json |
Supported Models
All models support the same parameters and functionality:
OpenAI Models
- GPT-5 (
gpt-5
) - Latest GPT-5 model - GPT-5 Chat Latest (
gpt-5-chat-latest
) - Optimized for chat - GPT-4o (
gpt-4o
) - High-performance model
Anthropic Models
- Claude 3.5 Haiku (
claude-3-5-haiku-20241022
) - Fast and efficient - Claude 3.5 Sonnet (
claude-3-5-sonnet-20240620
) - Balanced performance - Claude 3.7 Sonnet (
claude-3-7-sonnet-20250219
) - Latest Sonnet model
Deepseek Models
- Deepseek Chat (
deepseek-chat
) - General chat model - Deepseek R1 (
deepseek-reasoner
) - Advanced reasoning model
Request Parameters
Parameter | Type | Supported Values | Description | Required |
---|---|---|---|---|
type | string | CODE_GENERATOR | Feature name | ✔️ |
model | string | See supported models above | Model identifier | ✔️ |
conversationId | string | CODE_GENERATOR | Conversation ID | ✔️ |
promptObject.prompt | string | Any text | Code generation prompt | ✔️ |
promptObject.webSearch | boolean | true , false | Enable web search for additional context | ❌ |
promptObject.numOfSite | number | 1-10 | Number of websites to search | ❌* |
promptObject.maxWord | number | 100-10000 | Maximum words per website | ❌* |
*Required when webSearch
is true
Code Example
- cURL
- JavaScript
- Python
curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"type": "CODE_GENERATOR",
"model": "claude-3-5-sonnet-20240620",
"conversationId": "CODE_GENERATOR",
"promptObject": {
"prompt": "Create a Python function to calculate the factorial of a number recursively",
"webSearch": false
}
}'
fetch('https://api.1min.ai/api/features', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'CODE_GENERATOR',
model: 'claude-3-5-sonnet-20240620',
conversationId: 'CODE_GENERATOR',
promptObject: {
prompt: 'Create a Python function to calculate the factorial of a number recursively',
webSearch: false
}
})
})
import requests
url = "https://api.1min.ai/api/features"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "CODE_GENERATOR",
"model": "claude-3-5-sonnet-20240620",
"conversationId": "CODE_GENERATOR",
"promptObject": {
"prompt": "Create a Python function to calculate the factorial of a number recursively",
"webSearch": False
}
}
response = requests.post(url, headers=headers, json=data)
Interactive Playground
Try the API directly in your browser:
API Playground
https://api.1min.ai/api/features
Choose the AI model for code generation
Identifier for the conversation context
Describe what code you want to generate
Enable web search for additional context and latest information
Generated cURL Command:
curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "CODE_GENERATOR",
"model": "claude-3-5-sonnet-20240620",
"conversationId": "CODE_GENERATOR",
"promptObject": {
"prompt": "Create a Python function to calculate the factorial of a number recursively",
"webSearch": false,
"numOfSite": 3,
"maxWord": 1000
}
}'
Response Format
{}