You can use any model, including open-weight models, as long as the vectors your endpoint returns come from the same model (and the same preprocessing) you used to create the embeddings you imported.
How It Works
The call to your endpoint is made from your browser, not from Encord’s servers. Encord’s backend signs a short-lived token for each user, the browser sends the query and token to your endpoint, and then sends the returned vector to Encord to run the search. This has three consequences for how you deploy your endpoint:- Network access: your endpoint must be reachable from the browsers of everyone who searches in Encord. There is no fixed Encord IP address to allowlist. An internet-facing endpoint works for everyone; an endpoint on your internal network or VPN works only for users connected to it.
- CORS: because the request comes from a browser, your endpoint must answer CORS preflight requests from the Encord app.
- Authentication: you authenticate requests by verifying the signed token, not by IP address or a shared secret.
Before You Begin
- Your custom embeddings are imported and enabled on your top-level folder.
- You have the embedding key you added to your metadata schema (for example,
my-model-embedding) and its size. - You are an Admin of your Encord Organization (needed to create a service integration).
- You can host an HTTPS endpoint that runs your model.
Step 1: Build Your Endpoint
Your endpoint accepts aPOST request with a JSON body and returns the embedding as a JSON array of numbers.
Request
Response
Return HTTP200 with a JSON array of numbers:
- The array length must match the size of the embedding in your metadata schema.
- Normalize the vector the same way you normalized your imported embeddings.
- Any status other than
200, or a body that is not an array of numbers, is shown to the user as a failed search.
CORS
Allow the Encord app origin to call your endpoint. Your endpoint must respond to theOPTIONS preflight with at least:
Use
https://app.us.encord.com if your Organization is on the US platform.Step 2: Verify Every Request
Every request carriesAuthorization: Bearer <token>, a JWT signed by Encord. Reject any request whose token does not verify.
The token also includes a
sub claim containing the email address of the Encord user who ran the search, which you can use for logging or per-user access control.
Public keys (JWKS):
- US platform: replace
https://api.encord.comwithhttps://api.us.encord.comin all the URLs above. - Your Encord representative can confirm your
<organisation-id>and the exact issuer URL during setup. - Cache the JWKS response rather than fetching it on every request.
Step 3: Create a Service Integration
A service integration holds the key pair Encord uses to sign tokens for your endpoint.- Go to your Workspace Organization settings and select Service integrations.
- Click New service integration.
- Enter:
- Title: A meaningful name for the integration. For example
Embedding search. - Target domain: The origin of your endpoint including
https://, for examplehttps://embed.example.com. Do not include the path; you send that separately in Step 4. This value is also the token’saudclaim. - Signing algorithm: EdDSA (Ed25519) is recommended. Choose ES256 only if your JWT library does not support EdDSA.
- Title: A meaningful name for the integration. For example
- Click Create service integration.
- Copy the UUID shown next to the integration’s title. You can also click Download public key if you prefer to pin the key instead of using the JWKS URL.
Step 4: Send Your Details to Encord
Send your Encord contact:- The service integration UUID from Step 3.
- Your embedding key (for example,
my-model-embedding). - The endpoint path (for example,
/v1/embed). Encord combines it with your Target domain to form the full URL, sohttps://embed.example.com+/v1/embedbecomeshttps://embed.example.com/v1/embed. - Whether your endpoint supports text, images, or both.
Step 5: Test Search
- Go to Data > Explore and select your top-level folder.
- Select your custom embedding from the Embedding selector.
- Type a search query, or upload an image.
Example Endpoint (Python)
This example uses FastAPI and PyJWT. Replacemy_model with your own model code.

