codai docs
API referenceGateway

Cards

Data for typed cards: weather, places, geocoding, static maps, exchange rates and link previews as ready card blocks.

Every JSON endpoint returns { block, provenance }, where block is a valid @codai/cards block. Places, geocoding and static maps are billed at Google list price and limited per user per day (200 Places, 500 maps, 500 link previews, 2000 renders; super_admin exempt). POST /v1/cards/render turns a chart or qr block into a PNG or SVG; Mermaid and math blocks are not supported yet (422 render_unsupported). Schema, agent tools and billing: cards guide.

GET
/v1/cards/weather

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

lat*number
Range-90 <= value <= 90
lng*number
Range-180 <= value <= 180
name?string

Display name of the location shown on the card.

Lengthlength <= 200

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A weather block and its provenance.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/weather?lat=-90&lng=-180'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/places

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

q?string
Lengthlength <= 300
lat?number
Range-90 <= value <= 90
lng?number
Range-180 <= value <= 180
radius?integer
Range50 <= value <= 50000
Default2000
type?string

Nearby only — up to 5 comma-separated Google place types, e.g. restaurant,cafe.

limit?integer
Range1 <= value <= 20
Default8
lang?string
Default"ro"
region?string
open_now?string
Value in"1""0""true""false"

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A places block (null when nothing matched) and its provenance, including the charged cost.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/places'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/geocode

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

address*string
Length2 <= length <= 300
lang?string
Default"ro"
region?string

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A map block (null when the address was not found), the results and provenance.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/geocode?address=string'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/static-map

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

center?string
zoom?integer
Range1 <= value <= 20
w?integer
Range64 <= value <= 640
Default640
h?integer
Range64 <= value <= 400
Default400
markers?string
maptype?string
Default"roadmap"
Value in"roadmap""satellite""terrain""hybrid"
lang?string
Default"ro"
path?string

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

The map image.

response?fileimage/png
Formatbinary
Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/static-map'
Example Response
"string"
GET
/v1/cards/fx

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

source?string
Default"bnr"
Value in"bnr""ecb"
from?string
to?string
amount?number
Default1
quote?string
symbols?string

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A metric or table block and its provenance (publication date).

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/fx'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/route

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

origin?string
from?string
Length2 <= length <= 300
destination?string
to?string
Length2 <= length <= 300
mode?string
Default"drive"
Value in"drive""walk""bicycle""transit""two_wheeler"
depart_at?string
Formatdate-time
lang?string
Default"ro"
region?string

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A map block, the route summary (both null when no route) and provenance.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/route'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/track

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

awb*string
Match^[A-Za-z0-9 ]{6,40}$
carrier?string
Value in"sameday""fan""cargus""dpd"

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A timeline block (null when there are no events), the tracking result and provenance (tracking link).

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/track?awb=string'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
GET
/v1/cards/efactura

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Query Parameters

limit?integer
Range1 <= value <= 50
Default10

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Response Body

A table block (null when there are no documents), the documents and provenance.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X GET 'https://ai.codai.ro/v1/cards/efactura'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
POST
/v1/cards/unfurl

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Request Body

application/json
  1. body
url*string
Lengthlength <= 2048

Response Body

A links block with one preview item and its provenance.

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X POST 'https://ai.codai.ro/v1/cards/unfurl' \  -H 'Content-Type: application/json' \  -d '{  "url": "string"}'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
POST
/v1/cards/product

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Request Body

application/json
  1. body
url*string
Lengthlength <= 2048
lang?string

Language of the availability badge (for example "Out of stock" / "Stoc epuizat").

Default"en"
Value in"en""ro"

Response Body

A products block with one item and its provenance (source page).

application/json
  1. response

A ready-to-render card block from @codai/cards plus where its data came from.

block*

A card block (weather, places, map, metric, table or links); null when nothing matched.

results?array<>

Geocode only — the raw matches behind the map block.

route?

Route only — { mode, durationS, staticDurationS, distanceM, polyline }, null when no route was found.

result?

Track only — the carrier, AWB, whether live tracking is configured, events and the tracking link.

documents?array<>

e-Factura only — the caller's fiscal documents with their ANAF e-Factura status.

provenance*

Source, attribution, fetch time, whether it came from cache and (for paid calls) the charged cost.

Example Request
curl -X POST 'https://ai.codai.ro/v1/cards/product' \  -H 'Content-Type: application/json' \  -d '{  "url": "string"}'
Example Response
{  "block": {},  "results": [    {}  ],  "route": {},  "result": {},  "documents": [    {}  ],  "provenance": {}}
POST
/v1/cards/render

Authorization

bearerAuth
headerAuthorizationBearer <codai_…>

A codai API key (codai_ prefix). Ephemeral tokens from POST /v1/tokens are accepted only by the media surfaces matching their scope (/v1/realtime, /v1/audio/*, /v1/embeddings).

Header Parameters

x-request-id?string

Client correlation id; echoed back as x-codai-trace-id and persisted on the usage row.

Lengthlength <= 128

Request Body

application/json
  1. body
block*

A chart or qr card block.

format?string
Default"png"
Value in"png""svg"
width?integer
Range64 <= value <= 1200
Default480
height?integer
Range64 <= value <= 1200
Default300
theme?string
Default"light"
Value in"light""dark"
scale?integer
Range1 <= value <= 3
Default2

Response Body

The image. x-codai-render-size carries the output size in pixels (WIDTHxHEIGHT).

response?file
Formatbinary
Example Request
curl -X POST 'https://ai.codai.ro/v1/cards/render' \  -H 'Content-Type: application/json' \  -d '{  "block": {    "type": "string"  }}'
Example Response
"string"