API formats: how SiBear calls your agent

How to tell SiBear the shape of your agent's chat API, for the free scan and the paid Review: the named presets, a custom JSON description, a pasted sample, and setups for Dify, Open WebUI, LibreChat, LangGraph and the OpenAI ChatKit demo.

Pick one

The free scan's prepare request (POST /v1/prefilled-scan-requests) and the paid Review's agent step (PUT /v1/account/reviews/{order_id}/agent) take the same fields, and at most one of them:

FieldUse it when
noneThe address ends in /chat/completions (OpenAI style), or the agent takes {"message": "..."} and answers {"reply": "..."}. A paid Review also reads the shape from the connected code.
api_presetThe agent speaks one of the formats below unchanged.
custom_jsonAny other JSON API: you say where the message goes and where the reply is.
api_sampleYou have a real request body and reply body; SiBear reads their field names.

To work it out, read the person's code for the route behind the agent address: the request body it parses, the reply it returns, the header it reads the key from and whether it streams.

Presets

api_presetMessage goes toReply read fromKey header
openai_chatmessages (the conversation)choices.0.message.contentAuthorization: Bearer
anthropic_messagesmessages (the conversation)content.0.textx-api-key
generic_jsonmessagereplyAuthorization: Bearer
dify_chatquery, with Dify's inputs, user and streaming; the conversation id is carriedanswerAuthorization: Bearer
chatkitA ChatKit threads.create request; later turns add to the threadthe assistant message items of the streamAuthorization: Bearer
langgraph_runsinput.messages of a stateless run of the graph agentmessages.-1.content (the last message)x-api-key

Custom JSON

{"custom_json": {
  "message_field": "input.text",
  "reply_path": "data.answer",
  "message_format": "text",
  "auth_header": "Authorization",
  "auth_scheme": "Bearer",
  "body": {"model": "support-bot"}
}}
FieldMeaning
message_fieldWhere the message goes: a field name, or a dotted path into body. At most 64 characters. Default message.
message_formattext sends the latest message as a string; messages sends the conversation as a list of {role, content}. Default text.
reply_pathWhere the reply is, in the reply body or in each streamed event. Dotted; numbers are list positions and -1 is the last. Default reply.
auth_header, auth_schemeThe header the key goes in and the word before it. An empty scheme sends the key alone. Default Authorization and Bearer.
bodyA JSON object that every request starts from: a model or assistant id, required fields. At most 2 KB together with session.follow_up, nested at most 8 levels. The message is put into it at message_field; a list position in the path must name an item the body already has.
sessionFor an agent that keeps the conversation itself: reply_path is where its reply holds the conversation id, field where that id goes on later turns, and follow_up is merged into the body then. A later turn's body must still hold the message and then the id.
reply_whenFor a stream that mixes the agent's messages with other events: only an event whose string at path equals equals holds the reply.

A paid Review also reads what the agent did: the tool calls its reply returns beside the reply text, as an OpenAI-style tool_calls list ({"function": {"name", "arguments"}}) or the older function_call. On OpenAI-style chat that is choices.0.message.tool_calls, or choices.0.delta.tool_calls in a stream, put back together piece by piece; on custom_json it is the tool_calls field of the object that holds the text at reply_path (for reply_path: "data.answer", data.tool_calls). An agent that runs its tools without returning the calls is graded on its words alone. The free scan reads the reply text only.

A pasted sample

{"api_sample": {"request": "{\"question\": \"hello\", \"lang\": \"en\"}", "response": "{\"result\": {\"text\": \"Hi!\"}}", "auth_header": "X-Api-Key", "auth_scheme": ""}}

request and response are JSON text of at most 4 KB each, with harmless content such as a greeting. They are read for field names only, never sent or stored. Do not paste a real key or a user's data into them.

Common setups

AgentAddressWhat to send
Dify chat or agent apphttps://<host>/v1/chat-messagesapi_preset: "dify_chat"; the key is the app's API key.
Open WebUIhttps://<host>/api/chat/completionscustom_json with message_field: "messages", message_format: "messages", reply_path: "choices.0.message.content" and body: {"model": "<model id>"}. A knowledge collection may go in body too.
LibreChat Agents APIhttps://<host>/api/agents/v1/chat/completionsAs Open WebUI, with body: {"model": "<agent id>"}. The Agents API must be enabled for the key's role.
LangGraph serverhttps://<host>/runs/waitapi_preset: "langgraph_runs" for the graph agent. Another graph: custom_json with message_field: "input.messages", message_format: "messages", reply_path: "messages.-1.content", auth_header: "x-api-key", auth_scheme: "" and body: {"assistant_id": "<graph id>"}.
OpenAI ChatKit apphttps://<host>/chatkitapi_preset: "chatkit".
OpenAI-compatible endpointhttps://<host>/.../chat/completionsNothing. If it needs a model in the body, use custom_json as for Open WebUI.

When the agent does not answer

  • Every check refused as unauthorized (401 or 403). The key is wrong or in the wrong header. Check auth_header and auth_scheme against the code. A paid Review fails with a free re-run.
  • No usable answer to any check. The message went to the wrong field or the reply was read from the wrong place. Check message_field, message_format and reply_path against a real reply; for a streamed reply, reply_path is read in each event.
  • Each turn starts a new conversation. The agent keeps the conversation itself: add session. If the agent's reply never names the conversation id at session.reply_path, the checks that need the conversation are shown as "Not scannable", never as passed.
  • The scan or Review fails with `agent_format_unsupported`. The API format was accepted but SiBear's test runner could not build a request from it (or from the address's path). Nothing was sent to the agent. A free scan does not count against the month; a paid Review gets a free re-run.
  • The reply holds other events too. Add reply_when.
  • The address redirects. Give the final address; the scan never follows a redirect elsewhere.
  • A private or local address. SiBear tests only public addresses. Expose the staging copy on a public address you own, for example through a tunnel, and prove ownership of that address.
  • A model that answers in a list of content blocks. Point reply_path at the text block (for example content.0.text).

Errors on these fields come back as 422 validation_failed with fields naming the problem; see Limits and errors.