Skip to main content
POST
/
v1
/
evals
/
split
/
extract
/
{project_id}
Extract For Project
curl --request POST \
  --url https://api.retab.com/v1/evals/split/extract/{project_id} \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'document=<string>' \
  --form 'model=<string>' \
  --form image_resolution_dpi=123 \
  --form n_consensus=123 \
  --form 'metadata=<string>' \
  --form 'extraction_id=<string>'
{
  "id": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "<string>",
        "content": "<string>",
        "refusal": "<string>",
        "annotations": [
          {
            "type": "<string>",
            "url_citation": {
              "end_index": 123,
              "start_index": 123,
              "title": "<string>",
              "url": "<string>"
            }
          }
        ],
        "audio": {
          "id": "<string>",
          "data": "<string>",
          "expires_at": 123,
          "transcript": "<string>"
        },
        "function_call": {
          "arguments": "<string>",
          "name": "<string>"
        },
        "tool_calls": [
          {
            "id": "<string>",
            "function": {
              "arguments": "<string>",
              "name": "<string>",
              "parsed_arguments": null
            },
            "type": "<string>"
          }
        ],
        "parsed": null
      },
      "finish_reason": "stop",
      "logprobs": {
        "content": [
          {
            "token": "<string>",
            "logprob": 123,
            "top_logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ]
              }
            ],
            "bytes": [
              123
            ]
          }
        ],
        "refusal": [
          {
            "token": "<string>",
            "logprob": 123,
            "top_logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ]
              }
            ],
            "bytes": [
              123
            ]
          }
        ]
      },
      "key_mapping": {}
    }
  ],
  "created": 123,
  "model": "<string>",
  "object": "<string>",
  "service_tier": "auto",
  "system_fingerprint": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 123,
      "audio_tokens": 123,
      "reasoning_tokens": 123,
      "rejected_prediction_tokens": 123
    },
    "prompt_tokens_details": {
      "audio_tokens": 123,
      "cached_tokens": 123
    }
  },
  "extraction_id": "<string>",
  "likelihoods": {},
  "request_at": "2023-11-07T05:31:56Z",
  "first_token_at": "2023-11-07T05:31:56Z",
  "last_token_at": "2023-11-07T05:31:56Z"
}

Authorizations

Api-Key
string
header
required

Headers

Idempotency-Key
string | null

Path Parameters

project_id
string
required

Query Parameters

access_token
string | null

Body

multipart/form-data
document
string | null
model
string | null
image_resolution_dpi
integer | null
n_consensus
integer | null
metadata
string | null
extraction_id
string | null

Response

Successful Response

id
string
required
choices
RetabParsedChoice · object[]
required
created
integer
required
model
string
required
object
string
required
Allowed value: "chat.completion"
service_tier
enum<string> | null
Available options:
auto,
default,
flex,
scale,
priority
system_fingerprint
string | null
usage
CompletionUsage · object

Usage statistics for the completion request.

extraction_id
string | null
likelihoods
Likelihoods · object

Object defining the uncertainties of the fields extracted when using consensus. Follows the same structure as the extraction object.

request_at
string<date-time> | null

Timestamp of the request

first_token_at
string<date-time> | null

Timestamp of the first token of the document. If non-streaming, set to last_token_at

last_token_at
string<date-time> | null

Timestamp of the last token of the document