Skip to content

Grill API Reference

Reference for every /grill/* endpoint on POMA AI API v3.

  • Base URL: https://api.poma-ai.com/v3
  • Auth: Authorization: Bearer <project-api-key> for every endpoint. The project must have product: "grill".
  • Spec: Swagger UI

For higher-level walkthroughs, see Ingestion, Retrieval, RetrievalContext format, and Document management.

Endpoint summary

MethodPathPurpose
POST/grill/ingestSubmit a file for ingestion into the project's Grill namespace.
POST/grill/searchHybrid search across the namespace; returns prompt-ready context.
POST/grill/searchInDocSame as /grill/search but doc_filter is required.
GET/grill/docsList documents in the namespace.
GET/grill/docs/{docId}Get metadata for one document.
DELETE/grill/docs/{docId}Remove a document's vectors and storage.

The standard /jobs/{job_id}/... endpoints (status, delete) are reused by Grill ingest jobs — they are documented under the main API.


POST /grill/ingest

Create an ingestion job. The body is raw bytes (application/octet-stream); the filename is carried in Content-Disposition. Multipart is not accepted.

Request headers

HeaderRequiredNotes
AuthorizationyesBearer <project-api-key>.
Content-Typeyesapplication/octet-stream.
Content-Dispositionyesattachment; filename="<name>.<ext>". The extension drives parser selection.

Response (201 Created)PublicJob

json
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "created_at": "2026-04-30T10:00:00Z",
  "properties": {
    "file": { "filename": "manual.pdf", "size": 1048576 }
  }
}

Status codes

StatusMeaning
201Job created. Poll status with GET /jobs/{job_id}/status or stream via GET /status/v1/jobs/{job_id}.
400Bad request (missing Content-Disposition, unsupported MIME, empty body).
401Missing/invalid Bearer token.
403Multipart submitted, or the project's product is primecut.
500Server error.

See Ingestion for the full lifecycle.


POST /grill/search

Hybrid retrieval. Returns a prompt-ready RetrievalContext.

Request bodyGrillSearchRequest

FieldTypeRequiredDescription
querystringyesNatural-language query.
doc_filterstringnoOptional document id filter. Use /grill/searchInDoc when this is required.
exclude_doc_idsarray of stringnoDoc ids to exclude from results (max 100). Useful in agent loops to avoid re-citing docs already shown.
return_assetsbooleannoInclude asset references in matched chunks.
return_page_imagesbooleannoInclude page image references.
min_relevancefloat 0..1noDrop hits below this score.
max_tokensintegernoToken budget for the rendered context block. Sandwich-aware truncation.

Result count is bounded server-side by relevance and the token budget — there is no top_k parameter.

Response (200 OK)RetrievalContext

json
{ "context": "<doc id=\"\">…</doc>" }

The context field is the entire response — see RetrievalContext format for the grammar.

Status codes

StatusMeaning
200OK.
400Validation error or upstream Grill 400.
401Missing/invalid token, or upstream 401.
403Upstream Grill 403.
404doc_filter references an unknown doc.
502Other upstream Grill / proxy error.
503Cannot reach the Grill backend.

POST /grill/searchInDoc

Same shape as /grill/search, but doc_filter is required and must be non-empty. Use this when you want server-side enforcement that retrieval stays inside one document.

Request bodyGrillSearchInDocRequest

FieldTypeRequiredDescription
querystringyesNatural-language query.
doc_filterstringyesDocument id to restrict search to.
exclude_doc_idsarray of stringnoDoc ids to exclude (max 100).
return_assetsbooleannoInclude asset references.
return_page_imagesbooleannoInclude page image references.
min_relevancefloat 0..1noScore threshold.
max_tokensintegernoToken budget.

Same as /grill/search: result count is bounded by relevance and the token budget; there is no top_k.

Response (200 OK)RetrievalContext (identical to /grill/search).

Status codes

StatusMeaning
200OK.
400Missing query, missing/empty doc_filter, or upstream 400.
401Missing/invalid token.
403Upstream Grill 403.
404Doc not found in this project's namespace.
502Upstream / proxy error.
503Grill backend unreachable.

GET /grill/docs

List documents in the project's namespace.

Response (200 OK)ListDocsResponse

json
{
  "namespace": "project_docs_rag_4f2",
  "total_documents": 3,
  "documents": [ DocInfo,  ]
}
FieldTypeDescription
namespacestringProject namespace identifier in the Grill backend.
total_documentsintegerCount of documents in the namespace.
documentsarrayDocInfo entries (see below).

Status codes

StatusMeaning
200OK.
401Missing/invalid token.
403Upstream Grill 403.
404Upstream Grill 404.
502 / 503Upstream issues.

GET /grill/docs/{docId}

Fetch metadata for one document.

Path parameters

NameTypeDescription
docIdstringThe exact doc_id returned by /grill/docs.

Response (200 OK)DocInfo

FieldTypeDescription
doc_idstringStable identifier within the namespace.
titlestringDetected title (filename fallback).
languagestringBCP-47 language code.
filenamestringOriginal ingest filename.
pagesintegerSource page count.
chunkset_countintegerChunksets produced.
chunk_countintegerChunks produced.
image_countintegerDetected figures/images.
table_countintegerDetected tables.
ingested_atstring (RFC 3339)Job completion time.
source_job_idstringjob_id of the originating /grill/ingest.

Status codes

StatusMeaning
200OK.
400Empty docId.
401Missing/invalid token.
403Upstream Grill 403.
404Doc not found in this namespace.
502 / 503Upstream issues.

DELETE /grill/docs/{docId}

Remove a document's vectors and storage from the namespace. Project, key, and other documents are unaffected.

Path parameters

NameTypeDescription
docIdstringDocument to delete.

Response (200 OK)DeleteDocResponse

FieldTypeDescription
doc_idstringEchoes the deleted docId.
vectors_deletedintegerVector count removed from the namespace.
storage_deletedbooleanWhether stored bytes (assets, page images) were removed.

Status codes

StatusMeaning
200OK.
400Empty docId.
401Missing/invalid token.
403Upstream Grill 403.
404Doc not found in this namespace.
502 / 503Upstream issues.

Schemas (canonical shapes)

These are the same definitions used by the OpenAPI v3 spec. All are JSON.

GrillSearchRequest

jsonc
{
  "query": "string (required)",
  "doc_filter": "string",
  "exclude_doc_ids": ["string"],
  "return_assets": false,
  "return_page_images": false,
  "min_relevance": 0.3,
  "max_tokens": 4000
}

GrillSearchInDocRequest

Same as GrillSearchRequest, except both query and doc_filter are required and doc_filter must be non-empty.

RetrievalContext

jsonc
{
  "context": "string (XML+Markdown — see RetrievalContext format page)"
}

DocInfo

jsonc
{
  "doc_id": "string (required)",
  "title": "string",
  "language": "string",
  "filename": "string",
  "pages": 0,
  "chunkset_count": 0,
  "chunk_count": 0,
  "image_count": 0,
  "table_count": 0,
  "ingested_at": "RFC 3339 timestamp",
  "source_job_id": "uuid"
}

ListDocsResponse

jsonc
{
  "namespace": "string",
  "total_documents": 0,
  "documents": [ /* DocInfo */ ]
}

DeleteDocResponse

jsonc
{
  "doc_id": "string",
  "vectors_deleted": 0,
  "storage_deleted": true
}

PublicJob (for /grill/ingest)

jsonc
{
  "job_id": "uuid",
  "created_at": "RFC 3339 timestamp",
  "status": { "job_id": "…", "status": "pending|processing|done|failed", "code": 200 },
  "properties": { "file": { "filename": "string", "size": 0 }, "base_url": "string" }
}

See also