Connection
The Connection setting decides whether the browser calls the API directly or sends requests through this site's proxy or a Worker you deploy yourself. By default, requests go through this site's proxy. Auto first checks whether the API allows web pages to call it directly and otherwise uses this site's proxy.
The browser's cross-origin restriction (CORS) decides whether a web page may read the response of an API. Many relays and third-party APIs do not allow web pages to call them directly, so the requests have to go through a server. That server is the forwarding proxy. On a direct call, your API key passes through no third party. Through a proxy, your API key, the challenges, and the model's answers pass through that server on their way to the API.
Local and private network APIs
The web app accepts HTTP API addresses on loopback and local networks, including custom ports. Examples include http://127.0.0.1:3065/v1/, http://localhost:3065/v1/, http://192.168.1.10:8080/v1/, and http://[::1]:3065/v1/.
These addresses always use a direct browser connection, regardless of the connection mode below. Cloud relays cannot reach the user's local network, so a failed direct request does not fall back to a proxy. The API must allow cross-origin requests (CORS). If the browser asks for local network access, grant that permission. Browsers can also restrict HTTP private network requests from HTTPS pages. In that case, host the web app locally or use the CLI.
For a local address, Connection shows Direct and disables the connection options. The Worker configuration is hidden. The saved connection setting for public APIs stays unchanged and reappears when you enter a public API address.
Supported local addresses include 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, IPv6 loopback, unique local addresses, and link-local addresses. Single-label hostnames and names under localhost, .localhost, .local, .internal, .lan, and .home.arpa are also accepted. Other addresses still require HTTPS. Custom domains that resolve to private IP addresses still require HTTPS.
OPTIONS preflight returns 401
Before a cross-origin POST with an API key, the browser automatically sends an OPTIONS preflight. Its Access-Control-Request-Headers header lists the header names needed by the actual request, but the preflight contains no API key. Actual Chat Completions and Responses requests carry Authorization: Bearer <API Key>. Messages requests carry x-api-key, and Gemini API requests carry x-goog-api-key.
If the server requires a key on the preflight, OPTIONS returns 401 and the browser does not send the actual POST. This does not mean that the page omitted the key. Page scripts cannot add a key to the browser's preflight or bypass a failed preflight.
Configure CORS in the local API server or its reverse proxy:
- Handle
OPTIONSbefore API key authentication. Return 200 or 204 for allowed origins. - Set
Access-Control-Allow-Originto allow the actual page origin, for examplehttps://lm.ikale.io. For a local deployment, use the page's protocol, hostname, and port. - Allow
POSTinAccess-Control-Allow-Methods. InAccess-Control-Allow-Headers, allow the headers listed by the preflight. Chat Completions and Responses needauthorization, content-type. Gemini API needsx-goog-api-key, content-type. Messages also needsx-api-key, anthropic-version, anthropic-dangerous-direct-browser-access, plusanthropic-betawhen a fast service tier is enabled. - Keep API key authentication on actual
POSTrequests. Include CORS headers that allow the page origin on both successful and error responses.
If you cannot change the local server, use the CLI. CLI requests are not subject to browser CORS restrictions. Hosting the web app locally does not necessarily solve preflight failures: different ports still make the page and API cross-origin.
The four connection modes
These modes apply to addresses other than the local targets described above.
"Connection" at the bottom of the API configuration has four options, with one sentence below the selected option that explains it. It is a browser-level setting. It applies to all profiles and is not written to exported configuration files.
| Option | Where requests go |
|---|---|
| Auto | Before each sampling or probing run, checks the API once: direct if it allows web pages to call it, otherwise through this site's proxy |
| Direct | Always from the browser straight to the API, without a proxy. Requests fail if the API does not allow cross-origin calls from web pages |
| This site's proxy (default) | Always through this site's proxy, /api/proxy |
| Own Worker | Always through the Worker you deployed |
The route is fixed when a run starts. Changing the connection mode during a run does not affect the requests in progress.
The check in Auto mode
Auto checks once before each sampling or probing run. During the check, the main button shows "Checking connection…" and the configuration is locked. The check takes at most about 8 seconds; if the API does not respond, Auto treats it as not allowed and uses this site's proxy. The result is not kept, so the next run checks again.
The check does not use up quota. Its request carries a dummy API key (sk-cors-check) and an empty body {}, and the API rejects it before it runs any model, so no model runs and no tokens are billed.
The check does not leak your real API key either, because the real key appears only in the requests that follow. Neither the check request nor a direct request carries cookies or a Referer, and neither follows redirects, so a redirect cannot send the API key elsewhere.
If the check reads any HTTP status from the API, even a rejection, web pages can call it directly. If it cannot read one, the API may refuse web pages, or the address or network may be wrong. The browser cannot tell these apart, and Auto uses this site's proxy in both cases.
flowchart TD
A["Start sampling or probing"] --> B{"Connection"}
B -->|Direct| C["Direct call, no proxy"]
B -->|This site's proxy| D["Forward through this site's proxy"]
B -->|Own Worker| E{"Valid Worker address?"}
E -->|Yes| F["Forward through your Worker"]
E -->|No| G["No request is sent; the page asks for the address"]
B -->|Auto| H["Check whether the API allows direct calls from web pages"]
H -->|Allowed| C
H -->|Refused or unreachable| D
When a direct call fails
When a direct request fails at the network level, the browser cannot identify whether the cause is the address, network, browser permission, or CORS configuration. For local APIs, the page asks you to check the server, local network permission, and CORS. It also explains that OPTIONS contains no key. Switching to a cloud proxy cannot solve a local API connection failure. For public APIs, check the address and your network first. If they are correct, switch to "This site's proxy" or "Own Worker". A failed direct request is not switched to a proxy automatically.
This site's proxy and your own Worker
The proxy this site provides, at /api/proxy, implemented as a Cloudflare Pages server function. It does not store API keys or log request content. If you deploy the website yourself on a static host without server functions, such as GitHub Pages, this proxy does not exist and you need to choose "Own Worker"; Auto also uses this proxy when the API does not allow direct calls.
"Check proxy" sends one GET health check to the Worker address you entered, without the API key. The result applies only to that address:
| Result | Possible cause | What to do |
|---|---|---|
| The Worker is available | It returned {"service":"fingerpoint-api-proxy"} | Nothing |
| The address responded, but this page cannot read the response | The address is not a Fingerprint proxy, or the Worker's ALLOWED_ORIGINS does not include the origin of the current page | Check that the address is the Worker you deployed, then add the current page's origin to ALLOWED_ORIGINS |
| The address responded, but it is not a Fingerprint proxy | The address points to another service | Check that you entered the Worker's address |
| The address cannot be reached | A DNS, certificate, or network problem | Check the address and your network |
What the browser stores
The connection mode and the Worker address are stored in the browser, and so are the API configuration and the API key. None of this is uploaded to this site. Your API key leaves the browser only when a request is sent, to the API or to a forwarding proxy, as the selected connection mode decides. Clearing this site's browser data removes all of it, and the connection mode returns to Auto.
Last updated on
Tokenizer probe
While sampling, API detection identifies the upstream tokenizer and checks whether it matches the model you entered. The result is reference information; it neither changes the ranking nor delays the detection result.
Command line
How to run fpd, its subcommands, environment variables, and update notifications.