Quickstart
This guide walks through your first authenticated call to generate text.
1. Get an API key
In the Krastie app, open Integrations → Krastie API and generate a key. Copy the full krastie_… value.
2. Send a request
curl https://api.krastie.ai/v1/ai/generate/text \
-H "api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"text": "Write a two-sentence intro for an AI visibility platform."
}'
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model identifier (for example gpt-4o) |
text | string | Yes | Prompt / instructions |
useWorker | boolean | No | If true, queues the job and returns 202 with a jobId |
options | object | No | Extra options passed to the worker when useWorker is true |
jobType | string | No | Worker job name (default ai_tool_content) |
3. Handle the response
Synchronous (default): the response body contains the generated content from the model pipeline.
Queued (useWorker: true):
{
"message": "Content generation queued",
"jobId": "123"
}
Poll the job until it completes:
curl https://api.krastie.ai/v1/ai/generate/job/123 \
-H "api-key: YOUR_KEY"
See Async jobs for the full job status payload.
Next steps
- Explore Generate for images, brand voice, and SEO endpoints
- Manage Chat sessions
- Track referrals with AI traffic