Docs / API reference

Embeddings, rerank, moderation

Updated 2026-11-22. Published by PentestLLM.

Three routes under https://api.pentestllm.ai/v1 serve the jobs around a chat model: turning findings into vectors for search, ordering documents by how well they match a question, and classifying text. Each catalog entry’s type and endpoints fields say which route takes it.

Routes

RouteBody limitStatuses
POST /v1/embeddings10 MB200, 400, 401, 402, 403, 404, 413, 424, 429, 502, 503
POST /v1/rerank2 MB200, 400, 401, 402, 403, 404, 413, 429, 502, 503
POST /v1/moderations10 MB200, 400, 401, 402, 403, 404, 413, 424, 429, 502, 503

Model routes take an ordinary key through whichever accepted header suits your client: Authorization, the Anthropic one or the Google one. An admin key is refused with 403 admin_key. Whether a console session is accepted, the OpenAPI document does not say.

Models in the catalog now

For embeddings:

  • bge-base-en-v1.5, $0.1665 per 1M input tokens
  • bge-m3, $0.0295 per 1M input tokens
  • bge-small-en-v1.5, $0.0505 per 1M input tokens
  • gemini-embedding-001, $0.15 per 1M input tokens
  • qwen3-embedding-0.6b, $0.0295 per 1M input tokens
  • text-embedding-3-large, $0.1607 per 1M input tokens
  • text-embedding-3-small, $0.4363 per 1M input tokens
  • text-embedding-ada-002, $0.10 per 1M input tokens

For rerank:

  • bge-reranker-base, $0.0078 per 1M input tokens

For moderation: no model is listed in the catalog today, so the route is described below without a working example.

Embeddings

POST /v1/embeddings requires model and input, a string or an array; other fields in the OpenAI request shape are passed through. The success body is declared only as an open object, the embedding list the model’s route returns, so its fields are not typed in the OpenAPI document.

Rerank

POST /v1/rerank follows the Cohere and Jina request shape:

FieldTypeNotes
modelstring, requiredA model whose catalog type is rerank.
querystring, requiredThe text every document is scored against.
documentsarray, requiredUp to 1,000 entries, each a string or an object with a text field.
top_nintegerKeep only the best n results. All of them when unset.
return_documentsbooleanEcho each document’s text in its result.

The answer has id (the request id), object list, model, results best first, each with the original index, a relevance_score where higher means closer, and document.text when asked for, plus usage with prompt_tokens and total_tokens. Billing is per input token: the query is counted again beside every document, at roughly four characters a token. A failed call costs nothing.

Moderation

POST /v1/moderations requires input, a string or an array, and takes an optional model. Left out, the call goes to text-moderation-latest by the OpenAPI document, an id the catalog does not list today, so treat the default as unconfirmed. Its prose describes the answer as OpenAI’s moderation object with results, flagged, categories and category_scores, but the schema types none of them. With no token count in the answer, billing takes the request size divided by four.

Errors

StatusCodes
400invalid_request: a malformed body, a missing required field, or a model of the wrong type for the route.
401invalid_api_key: no key, a key in the URL, or a key that is invalid or revoked.
402insufficient_balance, spend_cap_reached, a key limit such as monthly_limit_reached, or key_budget_exhausted.
403scope_denied when the key may not use the model, admin_key, account_frozen.
404model_not_found: the id is not in the catalog.
413invalid_request: the body passed its ceiling.
424mcp_server_error, declared on embeddings and moderation only.
429rate_limited, or upstream_rate_limited when the model is busy.
502upstream_error: the last route tried failed. Not charged.
503upstream_unavailable: no route for the model can answer now (typed overloaded_error in Anthropic-format answers).

Embeddings and moderation also list user_budget_reached and the daily and weekly limits under 402, credential_required under 403, and session_cap and loop_detected under 429; see Spend limits.

Example

shell
1curl "https://api.pentestllm.ai/v1/rerank" \
2 -H "Authorization: Bearer sk-ptl-live-…" \
3 -H "Content-Type: application/json" \
4 -d '{"model": "bge-reranker-base", "query": "Which finding involves exposed credentials?", "documents": ["An API token appears in a debug log.", "A response omits a cache header."], "top_n": 1}'

Questions

Can I rerank with a chat model?

No. Pick a catalog entry whose type is rerank and whose endpoints include the rerank route; a model of another type is turned away with a 400.

Where is the embeddings response schema?

The OpenAPI document leaves it as an open object, passed on as the model route returns it. This page does not guess vector sizes or fields from another provider’s docs.

Can I moderate text today?

The route is documented, but whether a model answers on it depends on the catalog. The list above is read from the live catalog and says when none is listed.

Join on TelegramHelp