Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.thehog.ai/llms.txt

Use this file to discover all available pages before exploring further.

Send a POST request to /api/generate/estimate to get a pre-flight estimate for a generation job before you commit credits. The endpoint accepts the same parameters as POST /api/generate and returns the estimated credit cost, whether the request would run synchronously or asynchronously, and the expected latency range. No content is generated and no credits are charged.

Request

POST https://api.thehog.ai/api/generate/estimate This endpoint accepts the same body parameters as POST /api/generate. Refer to that page for the full parameter reference. The key parameters that affect the estimate are:
output
string
"text" or "image". Affects model selection and credit cost.
prompt
string
The generation prompt. Longer prompts increase estimated token counts.
length
string
"short" or "long". Determines whether the estimate predicts sync or async execution.
projectId
string
Project scope. Affects context injection and billing grouping.
sourceType
string
Social mode source type. Affects which generation path is estimated.
sourceId
string
Social mode source row ID.
regenerate
boolean
Social mode regeneration flag.
writingStyleId
string
Writing style override for social mode.
executionType
string
Social mode execution type ("reply" or "quote_repost").
model
string
AI mode model override. Different models have different per-token credit rates.
schema
object
AI mode JSON Schema for structured output.
systemPrompt
string
AI mode system prompt override.
temperature
number
AI mode sampling temperature (0–2).
maxTokens
number
AI mode max output tokens. Setting a high value increases the upper bound of the credit estimate.

Response

Returns 200 OK synchronously. No credits are charged.
data
object
required
The pre-flight estimate.
meta
object
required

Example

curl --request POST \
  --url https://api.thehog.ai/api/generate/estimate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "Write a detailed competitive analysis comparing our pipeline intelligence platform to Clover Analytics and PipelineIQ, covering pricing, features, and positioning.",
    "length": "long"
  }'