---
title: "Generate credential embedding"
method: POST
path: "/ai/embed"
tags: ["AI Intelligence"]
---

# Generate credential embedding

`POST /ai/embed`

## Request

- Base URL: `https://app.arkova.ai/api/v1`
- URL: `https://app.arkova.ai/api/v1/ai/embed`
- Auth: HTTP bearer

Generate a 768-dim embedding for a credential and store in pgvector. Costs 1 AI credit.

## Request body

- EmbedRequest
  - `anchorId` string, uuid, required: Anchor ID to generate embedding for
  - `sourceText` string: Optional PII-stripped text to embed (auto-generated from metadata if omitted)

## Response `201`

Embedding generated and stored

## Other responses

- `401`: Authentication required
- `402`: Insufficient AI credits (`insufficient_credits`) — the org's metered balance is exhausted
- `503`: Either the API is not enabled (feature flag off), or AI credit accounting could not be confirmed (`credit_system_unavailable`: the credit RPC was contended or unavailable). Nothing was charged and no embedding was kept. Retryable — honour the `Retry-After` header.

---

[API](https://skmtc.dev/arkova/apis/arkova-verification-api.md) · [All operations](https://skmtc.dev/arkova/apis/arkova-verification-api/llms.txt) · [OpenAPI document](https://skmtc.dev/arkova/apis/arkova-verification-api/revisions/a14858d1efd4?raw)
