# Abot World 0

> Abot World 0 API endpoint


## Overview

- **Endpoint**: `https://fal.run/fal-ai/abot-world-0/start-session`
- **Model ID**: `fal-ai/abot-world-0/start-session`
- **Category**: unknown
- **Kind**: inference


## Pricing

- **Price**: $0 per compute seconds

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## Realtime API (WMA/WebRTC)

This endpoint publishes a WMA WebRTC contract. Open it with `fal.realtime.open`; do **not** call the session endpoint with `fal.run`, `fal.subscribe`, or the Queue API.

The browser negotiates through fal and then exchanges media with the model over WebRTC.

Client contract for the WebRTC session created by the linked OpenAPI operation.


### Install the experimental client

```bash
npm install @fal-ai/client@alpha @fal-ai/server-proxy@alpha
```

### Authentication and server proxy

Keep `FAL_KEY` on your server. Expose an authenticated proxy route to the browser. In a Next.js App Router application, create `app/api/fal/proxy/route.ts`:

```typescript
import { route } from "@fal-ai/server-proxy/nextjs";

export const { GET, POST, PUT } = route;
```

Protect that route with your application's authentication before deploying it.

### Open a browser session

```typescript
import { createFalClient } from "@fal-ai/client";
import { wma } from "@fal-ai/client/realtime";

const fal = createFalClient({ proxyUrl: "/api/fal/proxy" });

const session = fal.realtime.open(wma("fal-ai/abot-world-0"), {
  receive: [
    "video"
  ],
  onMedia: (stream) => {
      const element = document.querySelector("video");
      if (element) element.srcObject = stream;
    },
  onData: (raw) => {
      const message = JSON.parse(raw);
      console.log(message);
    },
  onState: (state) => console.log("realtime:", state),
  onError: (error) => console.error(error),
});


// Consult the session flow and message reference before sending control messages.

// Later, release the peer connection and network resources:
// await session.close();
```

## Session flow

This world starts automatically. Wait for the first video frame before using the movement controls.

Send ` commands ` with held controls in ` active ` and newly pressed controls in ` activated `. Send empty arrays when controls are released or focus leaves the world.

- Send ` configure ` and wait for ` configured ` before sending another world update. Setup is optional and can be used once per session.
- Send ` reset ` and wait for ` reset_applied ` before sending another world update.
- Send ` prompt ` and wait for ` prompt_applied ` before sending another world update.

World updates run one at a time and must not be replayed automatically. A ` error ` event is diagnostic and does not identify a failed update; read ` /error ` for details. The session ends on ` stream_exhausted `.


## Media contract

Tracks are described from the browser's perspective.

### Browser sends to the model

None.

### Browser receives from the model

- `video` — optional
  - Settings: `{"width":1280,"height":704,"frameRate":16}`

## Client-to-model control messages

### Movement

- **Wire type**: `commands`
- **Payload**: `object`

Semantic command-state report.

``active`` contains commands currently held by the user and ``activated``
contains edge-triggered commands since the previous report. A browser may
map a keyboard, gamepad, touch control, or agent action to these names.

- **`active`** (`string[]`, _optional_)
  - Constraints: maxItems=8
  - Array items: `string`
    - Values: `"forward"`, `"left"`, `"backward"`, `"right"`, `"look_up"`, `"look_left"`, `"look_down"`, `"look_right"`
- **`activated`** (`string[]`, _optional_)
  - Constraints: maxItems=8
  - Array items: `string`
    - Values: `"forward"`, `"left"`, `"backward"`, `"right"`, `"look_up"`, `"look_left"`, `"look_down"`, `"look_right"`
- **`type`** (`string`, _required_)
  - Constant: `"commands"`

**Example**

```json
{
  "active": [
    "forward"
  ],
  "activated": [],
  "type": "commands"
}
```

### Customize world

- **Wire type**: `configure`
- **Payload**: `object`

Optionally replace the automatic default world, once per connection.

Await ``configured`` before submitting more controls. Use ``reset`` for
subsequent restarts. Image URL takes precedence over the preset.

- **`preset`** (`string | null`, _optional_)
  Choose a built-in world, or provide a starting image below.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=100
    2. `null`
- **`prompt`** (`string | null`, _optional_)
  Optionally replace the starting world's description.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=2000
    2. `null`
- **`image_url`** (`string | null`, _optional_)
  Use your own image instead of a built-in world.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=4096
    2. `null`
- **`type`** (`string`, _required_)
  - Constant: `"configure"`

**Example**

```json
{
  "preset": "example",
  "type": "configure"
}
```

### Client keys message

- **Wire type**: `keys`
- **Payload**: `object`

Legacy physical-key report retained for existing WMA clients.

- **`pressed`** (`string[]`, _optional_)
  - Constraints: maxItems=32
  - Array items: `string`
- **`activated`** (`string[]`, _optional_)
  - Constraints: maxItems=32
  - Array items: `string`
- **`type`** (`string`, _required_)
  - Constant: `"keys"`

**Example**

```json
{
  "type": "keys"
}
```

### Client ping message

- **Wire type**: `ping`
- **Payload**: `object`

Latency probe; the server echoes ``ts`` back in a ``pong`` payload.

- **`ts`** (`number | null`, _optional_)
  - Default: `null`
- **`type`** (`string`, _required_)
  - Constant: `"ping"`

**Example**

```json
{
  "type": "ping"
}
```

### Update world

- **Wire type**: `prompt`
- **Payload**: `object`

- **`prompt`** (`string`, _required_)
  Change the scene's description while continuing this world.
  - Constraints: minLength=1, maxLength=2000
- **`type`** (`string`, _required_)
  - Constant: `"prompt"`

**Example**

```json
{
  "prompt": "A realistic outdoor world scene with a navigable path, natural lighting, detailed ground texture, and stable forward motion.",
  "type": "prompt"
}
```

### Restart world

- **Wire type**: `reset`
- **Payload**: `object`

- **`preset`** (`string | null`, _optional_)
  Choose a built-in world, or provide a starting image below.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=100
    2. `null`
- **`prompt`** (`string | null`, _optional_)
  Optionally replace the starting world's description.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=2000
    2. `null`
- **`image_url`** (`string | null`, _optional_)
  Use your own image instead of a built-in world.
  - Default: `null`
  - anyOf alternatives:
    1. `string`
      - Constraints: maxLength=4096
    2. `null`
- **`type`** (`string`, _required_)
  - Constant: `"reset"`

**Example**

```json
{
  "preset": "example",
  "type": "reset"
}
```

### End session

- **Wire type**: `stop`
- **Payload**: `object`

- **`type`** (`string`, _required_)
  - Constant: `"stop"`
- Additional properties: not allowed

**Example**

```json
{
  "type": "stop"
}
```

## Model-to-client control messages

### Server configured message

- **Wire type**: `configured`
- **Payload**: `object`

- **`type`** (`string`, _required_)
  - Constant: `"configured"`

**Example**

```json
{
  "type": "configured"
}
```

### Server error message

- **Wire type**: `error`
- **Payload**: `object`

- **`error`** (`string`, _required_)
- **`retryable`** (`boolean | null`, _optional_)
  Whether retrying unchanged input may succeed; absent if unspecified.
  - Default: `null`
- **`type`** (`string`, _required_)
  - Constant: `"error"`

**Example**

```json
{
  "error": "string",
  "type": "error"
}
```

### Server pong message

- **Wire type**: `pong`
- **Payload**: `object`

Reply to a ``ping``, echoing the client's timestamp for RTT measurement.

The echoed timestamp has two wire spellings: apps that handle ``ping``
themselves echo ``ts``; the fallback handler in
:class:`registry.wma.sdk.Session` replies with ``client_ts``. Clients read
whichever is present. ``server_ts`` is the (unsynchronized) runner clock; it
only shows how the round trip divides once the client has an offset estimate.

- **`client_ts`** (`number | null`, _optional_)
  - Default: `null`
- **`ts`** (`number | null`, _optional_)
  - Default: `null`
- **`server_ts`** (`number | null`, _optional_)
  - Default: `null`
- **`type`** (`string`, _required_)
  - Constant: `"pong"`

**Example**

```json
{
  "type": "pong"
}
```

### Server prompt_applied message

- **Wire type**: `prompt_applied`
- **Payload**: `object`

- **`type`** (`string`, _required_)
  - Constant: `"prompt_applied"`

**Example**

```json
{
  "type": "prompt_applied"
}
```

### Server reset_applied message

- **Wire type**: `reset_applied`
- **Payload**: `object`

- **`type`** (`string`, _required_)
  - Constant: `"reset_applied"`

**Example**

```json
{
  "type": "reset_applied"
}
```

### Server session_info message

- **Wire type**: `session_info`
- **Payload**: `object`

- **`turn`** (`boolean`, _required_)
- **`default_prompt`** (`string`, _required_)
- **`resolution`** (`object`, _required_)
  - **`width`** (`integer`, _required_)
  - **`height`** (`integer`, _required_)
- **`model_id`** (`string`, _required_)
- **`type`** (`string`, _required_)
  - Constant: `"session_info"`
- **`conflict_groups`** (`string[][]`, _required_)
  - Array items: `string[]`
    - Array items: `string`
- **`model_revision`** (`string`, _required_)
- **`presets`** (`object[]`, _required_)
  - Array items: `object`
    - **`name`** (`string`, _required_)
    - **`prompt`** (`string`, _required_)
- **`key_order`** (`string[]`, _required_)
  - Array items: `string`
- **`turn_status`** (`string`, _required_)
- **`frames_per_block`** (`integer`, _required_)
- **`frames_per_second`** (`number`, _required_)
- **`max_blocks`** (`integer`, _required_)

**Example**

```json
{
  "turn": true,
  "default_prompt": "string",
  "resolution": {
    "width": 0,
    "height": 0
  },
  "model_id": "string",
  "type": "session_info",
  "conflict_groups": [],
  "model_revision": "string",
  "presets": [],
  "key_order": [],
  "turn_status": "string",
  "frames_per_block": 0,
  "frames_per_second": 0,
  "max_blocks": 0
}
```

### Server stats message

- **Wire type**: `stats`
- **Payload**: `object`

- **`block_seconds`** (`number`, _required_)
- **`queue_depth`** (`integer`, _required_)
- **`generation_fps`** (`number`, _required_)
- **`queue_age_ms_max`** (`number`, _required_)
- **`type`** (`string`, _required_)
  - Constant: `"stats"`
- **`gpu_wait_frac`** (`number`, _required_)
- **`pace_sleep_ms_avg`** (`number`, _required_)
- **`queue_age_ms_p50`** (`number`, _required_)
- **`block_index`** (`integer`, _required_)

**Example**

```json
{
  "block_seconds": 0,
  "queue_depth": 0,
  "generation_fps": 0,
  "queue_age_ms_max": 0,
  "type": "stats",
  "gpu_wait_frac": 0,
  "pace_sleep_ms_avg": 0,
  "queue_age_ms_p50": 0,
  "block_index": 0
}
```

### Server stream_exhausted message

- **Wire type**: `stream_exhausted`
- **Payload**: `object`

The model has no more frames to send and the current peer is closing.
Clients must negotiate a new session to continue.

- **`type`** (`string`, _required_)
  - Constant: `"stream_exhausted"`

**Example**

```json
{
  "type": "stream_exhausted"
}
```

## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/abot-world-0/start-session)
- [API Documentation](https://fal.ai/models/fal-ai/abot-world-0/start-session/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/abot-world-0/start-session)
- [AsyncAPI Contract](https://fal.ai/api/apps/fal-ai/abot-world-0/asyncapi.json)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
