Skip to content
getgeolens.com

Generate Map Stream Endpoint

POST
/ai/generate-map/stream/
curl --request POST \
--url https://example.com/ai/generate-map/stream/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "language": "example", "prompt": "example" }'

Generate a map from a natural language prompt with streaming progress events.

Media type application/json
MapGenerateRequest
object
language
Any of:
string
prompt
required
Prompt
string
>= 3 characters <= 1000 characters
Example generated
{
"language": "example",
"prompt": "example"
}

Server-Sent Events stream

Media type text/event-stream

UTF-8 server-sent event frames. Each data field contains one JSON event payload described by x-geolens-event-schema.

string
Example
event: tool_start
data: {"type":"tool_start","tool":"create_map","label":"Building map..."}
event: done
data: {"type":"done","map_id":"0190...","map_name":"Flood risk","explanation":"Created the map","datasets_used":["Flood zones"]}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}