Code Generator
Generate code and programming solutions using various AI models through the 1min.AI API. This endpoint helps you create code snippets, complete functions, and get programming solutions for different languages and frameworks.
Available Models
Loading available models...
Request Parameters
All models share the same request structure:
| Field Name | Type | Supported Value | Description | Required |
|---|---|---|---|---|
| type | text | CODE_GENERATOR | Feature name | ✔️ |
| model | text | See available models | Model identifier | ✔️ |
| conversationId | text | 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 | ❌* |
Endpoint
Request Headers
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
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": "gpt-4o",
"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: 'gpt-4o',
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": "gpt-4o",
"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:
Loading interactive playground...
Response Format
{}