Graphon API

Answer a question

Answers a question about one target, with a citation marker for each source. The target is a bucket with indexing enabled, or a dataset from List datasets. Usually seconds. The call returns an answer or an error within about 2 minutes. The call waits for the answer and stores nothing. sources picks all, cited, or no sources. Scope the question with keys, keyPrefix, or a metadata filter. Requires the viewer role. An image is a premium feature.

POST/v1/workspaces/{workspaceId}/answer

Authentication

Send your Graphon API key with every request. The value is the whole API key that Graphon showed when you created it. See Authentication.

Authorization: Bearer <GRAPHON_API_KEY>

Path parameters

The workspace id.

Request body

targetstring

What to query: a bucket id (bkt…) of this workspace with indexing enabled, or a dataset id (dst…) from List datasets.

querystring

The question to answer. It must contain text. At most 32,000 characters.

historyobject[] (optional)

Earlier turns, oldest first. At most 32. Defaults to none.

imageobject (optional)Premium

Premium. A picture to ask about: PNG, JPEG, or WebP, at most 4 MiB. It adds up to 45 seconds. Graphon keeps no copy.

keysstring[] (optional)

Use only these object keys. At most 50. With keyPrefix, an object must match both. Defaults to every object of the bucket.

keyPrefixstring (optional)

Use only the objects whose key begins with this text, for example videos/2026/. Defaults to every object of the bucket.

filterobject (optional)

Use only the objects whose metadata matches. A clause is { field, op, value } on a metadata field that the bucket lists. text takes every operator. number and time take eq, neq, gt, gte, lt, and lte. bool takes eq and neq. A value is text, a number or a decimal string, an RFC 3339 time, or true or false; in takes an array of 1 to 100 values. and, or, and not combine clauses, at most 4 levels deep and 32 clauses in all. neq and not keep objects that have no value for the field. With keys or keyPrefix, an object must match all of them. A field that is still indexing after a change fails with metadata_field_indexing.

instructionsstring (optional)

How to write the answer, for example its length, tone, format, or language. They replace only the default style rules. They do not change the citations. At most 8,000 characters. A blank value is the same as none. Defaults to none.

sourcesstring (optional)

all: cited sources first, in the order the answer cites them, then the sources it only retrieved. cited: only the sources that the answer cites. none: no sources, and no [[SRC:0001]] markers in the answer. Defaults to all. One of: all, cited, none.

Was this page helpful?
View as Markdown