---
slug: /api
sidebar_position: 1
slide: /diagrams/abi-request.svg
slide_alt: A request hits a surface, then the kernel, then a process.
---

# API

The ABI process API is FastAPI in the ABI kernel. After `abi dev up` it listens on `http://localhost:9879`.

This is not the Naas wallet API at `api.naas.ai`. Wallet and ABI share a company, not a router.

## Surfaces

| Surface | Where |
|---|---|
| Nexus UI | `http://localhost:3042` |
| Process API | `http://localhost:9879` |
| Live OpenAPI | `http://localhost:9879/openapi.json` |
| Swagger | `http://localhost:9879/docs` |
| ReDoc | `http://localhost:9879/redoc` |

Port `9879` is `ApiConfiguration.port` in `.abi/libs/naas-abi-core/naas_abi_core/engine/engine_configuration/EngineConfiguration.py`. Port `3042` is Nexus UI, not the API.

## Agent routes

Every agent the kernel mounts gets the same two factory routes from `Agent.as_api`:

```text
POST /agents/{name}/completion
POST /agents/{name}/stream-completion
```

`{name}` is the agent `name` after `Agent.validate_name`. Enable a module in that workspace's `config.yaml` to mount more agents. This catalog lists agents that ship in the ABI packages (`naas_abi` plus marketplace AI providers). Workspace agents from `src/` are not listed.

## What the kernel mounts

`naas_abi_core.apps.api.api._load_runtime_routes` loads the Engine, then:

1. Instantiates each module agent and calls `Agent.as_api` (or `OpencodeAgent.as_api`)
2. Includes the `/agents`, `/pipelines`, and `/workflows` routers
3. Calls `module.api(app)` so a module can mount extra routers

Today only agents are auto-mounted. Pipeline and workflow classes implement `as_api` on `Expose`, but the kernel does not call those methods.

After `abi dev up`, the live spec is `http://localhost:9879/openapi.json`.

## Auth

See [Authentication](/api/authentication). There is no rate-limit layer in the ABI API app.
