Skip to main content
POST
Test Custom LLM Endpoint
Fish sends one streamed chat-completions turn to the endpoint saved in the agent’s draft llm.custom, using its base_url, model, API key and headers, with the draft’s system prompt and tools, and reports what came back. The request has no body. The test reads the draft, so a change you save with Update Voice Agent Draft Config can be tested right away. Calls use the published version, so publish once the test passes. To test a different endpoint, save it to llm.custom first. An agent with no custom LLM, or one saved without an API key, returns 422, and so does a request body with any field. A problem with your endpoint is not an HTTP error. An unreachable or blocked host, a timeout, a non-2xx reply, or a reply that isn’t a server-sent-event stream all return 200; read error and status_code to see what went wrong, not the HTTP status. To branch on the outcome, use type and reason. They take the same values as llm_endpoint_errors in Get Voice Agent Session, so an error you find here is the one you would see on a call. error is a readable explanation that can change, so don’t match on its text. The test sends one turn and doesn’t retry. It waits up to 10 seconds for the response headers and 10 seconds for the first content, gives up after 20 seconds in total, reads at most 256 KB of the reply, and doesn’t follow redirects. Your key and custom headers are never logged or returned; if your endpoint’s reply quotes them, they are masked in error. Each team can make 30 calls per minute to this endpoint. The 31st call within the same minute returns 429, and the count starts again in the next minute. For setup in the console and the llm.custom fields, see Custom LLM.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string
required

Response

Request fulfilled, document follows

Result of testing a custom LLM endpoint. A problem with your endpoint is reported here, not as an HTTP error: error explains it and type and reason name it.

latency_ms
integer
required

Total test time in milliseconds.

status_code
integer | null

HTTP status your endpoint returned; null when it was never reached.

streams_content
boolean
default:false

True when your endpoint streamed at least one chunk with text or a tool call.

tools_sent
integer
default:0

Number of the agent's tools included in the request, in OpenAI function format.

tool_calls_returned
integer
default:0

Number of distinct tool calls your endpoint streamed back.

ttft_ms
integer | null

Milliseconds from sending the request to the first chunk with text or a tool call; null when none arrived.

error
string | null

Readable explanation when the test failed; null on success. It is written for people and may change, so branch on type and reason instead.

type
enum<string> | null

Kind of failure, with the same values as type in a session's llm_endpoint_errors: http_error (your endpoint answered with a non-2xx status), timeout, connection_error (no answer) or invalid_response (a 2xx reply that was not usable). Null when the test succeeded.

Available options:
http_error,
timeout,
connection_error,
invalid_response
reason
enum<string> | null

Detail for connection_error and invalid_response, with the same values as reason in llm_endpoint_errors. For connection_error: dns_failed, connection_refused, connection_reset, tls_failed, address_not_allowed (an address Fish does not call) or unknown. For invalid_response: not_event_stream (the reply was not a stream), empty_reply (no text and no tool call) or unknown (the stream carried an error). Null otherwise.

Available options:
dns_failed,
connection_refused,
connection_reset,
tls_failed,
address_not_allowed,
not_event_stream,
stream_incomplete,
empty_reply,
refused,
unknown