Skip to content

What an AI extraction of requirements would send, and its estimated cost

POST
/v1/projects/{id}/requirements/import/extract/preview
curl --request POST \
--url https://beta-api.plune.ai/v1/projects/example/requirements/import/extract/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "markdown": "# Checkout notes\n\nWe talked about payments with the whole team today and agreed on the first version of the checkout page.\n- The system shall accept a card payment. Priority: High\n- Expired cards must be refused with a clear message.\nWe could maybe support Apple Pay later.\n" }'

The check before POST …/import/extractions (#1607, epic #1594): how many characters of the file would go to the project’s AI provider after secrets are masked, how many secrets were masked, the provider and model, and the estimated cost (the input at about four characters a token, plus the output ceiling). Nothing is sent, stored or counted. The project’s AI state is answered before the text is judged, so the file step of a client can say why the extraction is not offered (503 / 409). Then the text: more than 100000 characters is a 422 text_too_long (it is never cut), fewer than 20 words a 422 text_too_empty. An owner or a member (a reader gets 403); a bearer token only in the project it was minted in.

id
required
string

An id from GET /v1/projects

Media type application/json
object
markdown
required

The text: at most 100000 characters, at least 20 words.

string
language

The language of the titles; the project’s AI language when left out.

string
>= 2 characters <= 35 characters
Example
{
"markdown": "# Checkout notes\n\nWe talked about payments with the whole team today and agreed on the first version of the checkout page.\n- The system shall accept a card payment. Priority: High\n- Expired cards must be refused with a clear message.\nWe could maybe support Apple Pay later.\n"
}

What would be sent

Media type application/json
object
fetched
required
object
text
required

Characters sent, after masking.

integer
redactions
required

Secrets masked before anything leaves.

integer
provider
required
string
model
required
string
estimate
required
object
inputTokens
required
integer
maxOutputTokens
required
integer
>= 1
costUsd
required

Null when the model has no price: unknown, never 0.

number
nullable
Example
{
"fetched": {
"text": 412
},
"redactions": 0,
"provider": "anthropic",
"model": "claude-haiku-4-5",
"estimate": {
"inputTokens": 290,
"maxOutputTokens": 32768,
"costUsd": 0.16413
}
}

Invalid JSON or body

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No / invalid token or session

You are in the project as a reader

No such project among yours (or a token of another project)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

No AI provider connected (ai_not_connected), AI turned off (ai_disabled), or a saved key this server cannot read (key_rejected, the extraction only)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

text_too_long (more than 100000 characters, with limit) or text_too_empty (fewer than 20 words, with minWords)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over

No AI platform key on this server (platform_not_configured)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}