Skip to main content
POST
/
api
/
v1
/
iframe
/
create
Create iframe link
curl --request POST \
  --url https://api.camelai.com/api/v1/iframe/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "uid": "<string>",
  "srcs": [
    "<string>"
  ],
  "ttl": 900,
  "knowledge_base_entries": [
    "<string>"
  ],
  "reference_queries": [
    {}
  ],
  "model": "gpt-5",
  "response_mode": "full",
  "theme": {},
  "theme_id": 123,
  "show_sidebar": true,
  "limits": {
    "hourly": 2,
    "daily": 2,
    "weekly": 2,
    "monthly": 2
  }
}'
{
  "iframe_url": "<string>",
  "cache_key": "<string>",
  "expires_in": 123
}

Authorizations

Authorization
string
header
required

API key authentication using Bearer scheme

Body

application/json
uid
string
required

User identifier: The UID of the user to create the iframe for. This is used to track usage and thread history. This can be anything you want, but it must be unique. We recommend using a user ID or email.

Minimum length: 1
srcs
string[]
required

List of Source/Connection IDs: The IDs of the sources/connections to use for the iframe. This is used to determine which sources/connections the user will have access to in the chat.

ttl
integer
default:900

Token lifetime in seconds (60-3600, default: 900)

Required range: 60 <= x <= 3600
knowledge_base_entries
string[]

Array of session-specific (stateless) knowledge base entries. These temporary entries apply only to this iframe instance and do not persist. They work alongside any persistent (stateful) entries previously created through /api/v1/knowledge-base/ for your connection IDs.

reference_queries
object[]

Array of session-specific (stateless) reference query objects (e.g., {"title": "...", "query": "..."}). These temporary queries apply only to this iframe instance and do not persist. They work alongside any persistent (stateful) queries previously created through /api/v1/reference-queries/ for your connection IDs.

model
enum<string>
default:gpt-5

Model to use for generated threads

  • o3 - o3
  • o4-mini - o4-mini
  • gpt-4.1 - gpt-4.1
  • gpt-5 - gpt-5
  • sonnet-4 - sonnet-4
Available options:
o3,
o4-mini,
gpt-4.1,
gpt-5,
sonnet-4
response_mode
enum<string>
default:full

Response mode: "full" shows all details, "basic" hides technical details

  • full - full
  • basic - basic
Available options:
full,
basic
theme
object

Theme configuration to apply to the iframe (theme_mode, custom_css_vars, start_message)

theme_id
integer

ID of the theme to apply (mutually exclusive with theme)

show_sidebar
boolean
default:true

Show the chat sidebar inside the iframe (default: true)

limits
object

Optional per-uid rate limits

Response

iframe_url
string
required

URL for the iframe view

cache_key
string
required

Cache key for JWT retrieval

expires_in
integer
required

Token lifetime in seconds

I