Generate text with the configured AI provider.
Accepts a prompt and optional model/temperature knobs, then returns raw provider output. Defaults to `gpt-4o-mini` when `AI_PROVIDER=openai`, or a deterministic mock response when the Lambda is running in mock mode.
/ai/textWhere this helper shines
Generate text with the configured AI provider. keeps ai helpers on autopilot. Use it whenever you need to generate text with the configured AI provider without pausing a sprint or asking design/dev to jump in.
- Trigger this helper whenever you need to generate text with the configured AI provider without waiting on a full deploy.
- Drop it into automations (Zapier, Make, workers) to generate text with the configured AI provider as part of your workflow.
- Share the GET URL so support and success can generate text with the configured AI provider safely using their Dataczar API key.
Copy & ship snippets
GET
Instant link
GET https://api.dataczar.app/ai/text?prompt=sample-prompt&model=sample-model&temperature=30&max_tokens=40&ak=demoOpen directly in any browser, webhook, or low-code workflow.
curl
curl GET
curl "https://api.dataczar.app/ai/text?prompt=sample-prompt&model=sample-model&temperature=30&max_tokens=40&ak=demo"Swap ak=demo with your Dataczar API key.
curl
curl POST
curl -X POST "https://api.dataczar.app/ai/text?ak=demo" \
-H 'Content-Type: application/json' \
-d '{
"prompt": "sample_prompt",
"model": "sample_model",
"temperature": 30,
"max_tokens": 40,
"top_p": 50,
"presence_penalty": 60,
"frequency_penalty": 70,
"stop": "sample_stop",
"response_format": "sample_response_format",
"system_prompt": "sample_system_prompt",
"seed": 110,
"options": "sample_options"
}'Send JSON payloads from back-end jobs, queues, or workers.
Parameters
Query Parameters
| Name | Type | Description |
|---|---|---|
| prompt | string · required | Instruction or content to feed the model. |
| model | string | Override the default text model (e.g., `gpt-4o-mini`). |
| temperature | number | Sampling temperature (0-2). Lower is more deterministic. |
| max_tokens | integer | Maximum tokens to emit. When omitted the provider decides. |
| dryrun | boolean | When true the request is validated but not billed (mock provider only). |
All helper calls accept your Dataczar key via the ak query parameter. Need one? Create or copy a key on Dataczar Connect and drop it into each request.
Responses
Status 200
Generation succeeded.
{
"ok": true,
"status": 200,
"prompt": "Write a friendly launch announcement for Dataczar helpers.",
"model": "gpt-4o-mini",
"result": {
"provider": "openai",
"model": "gpt-4o-mini",
"temperature": 0.2,
"text": "\ud83d\ude80 Dataczar Helpers are live! Instantly generate slugs, AI copy, and polished assets with a single API call..."
}
}Examples
Request
"GET /ai/text?prompt=Write%20a%20fun%20tagline%20for%20Dataczar&ak=demo"Response
{
"ok": true,
"prompt": "Write a fun tagline for Dataczar",
"model": "gpt-4o-mini",
"result": {
"provider": "mock",
"text": "[mock:gpt-4o-mini] Write a fun tagline for Dataczar",
"temperature": 0.2
},
"status": 200
}Request
"POST /ai/text {\"prompt\":\"Summarize helper routing\",\"max_tokens\":128}"Response
{
"ok": true,
"model": "gpt-4o-mini",
"prompt": "Summarize helper routing",
"result": {
"provider": "mock",
"text": "[mock:gpt-4o-mini] Summarize helper routing",
"temperature": 0.2
},
"status": 200
}Test Contracts
[
{
"name": "basic_prompt",
"method": "GET",
"params": {
"prompt": "Say hello to Dataczar"
},
"expect": {
"ok": true
}
},
{
"name": "json_body_prompt",
"method": "POST",
"body": {
"prompt": "Give me a haiku about helpers",
"model": "gpt-4o-mini",
"temperature": 0.2
},
"expect": {
"ok": true
}
}
]Grab your Dataczar API key
Every helper runs with the same simple API key. Sign in (or create a free Dataczar account) at Dataczar Connect to issue keys in seconds, then drop the key into any `ak=` parameter and start shipping.
Tip: reuse the same key across these helpers, or rotate keys per project from the Connect dashboard.