> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomobile.ma/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use Gomobile customer-facing vocabulary.
> Do not infer support for internal, hidden, experimental, or unreleased features.

# Build an AI voice agent

> Create an agent, test its instructions, and prepare inbound publication.

Build a small inbound assistant before extending its scope.

## Before you begin

Configure [API access](https://docs.gomobile.ma/developers/api-basics.md), check available credits, and arrange an eligible phone number for inbound publication. Review the [Agents API](https://docs.gomobile.ma/developers/reference/agents.md) for publication and recording behavior.

**1. Create the agent**

Use `POST /agents` with a name and focused instructions. Start with the minimal request in [Create an agent](https://docs.gomobile.ma/developers/reference/agents.md#create-an-agent), using a synthetic product or service.

**2. Inspect its configuration**

Save the returned agent ID. Review the returned configuration. Discover enabled models and voices with the options endpoints before customizing the pipeline.

**3. Test with text**

Use `POST /agents/:id/test` with a representative question. Verify that the answer follows your instructions. This tests text behavior; it does not place a voice call.

**4. Review inbound publication**

Read the available numbers using `GET /agents/:id/available-dids`. Confirm the exact number set and recording requirements before using `POST /agents/:id/publish`.

**5. Check the voice experience**

After deliberate publication, call the bound number from a test phone. Check greeting, response behavior, and available call activity.

## Expected result

The text playground returns a response. After publication, the selected number routes inbound calls to the agent.

## Troubleshooting and limits

If no eligible number is returned, resolve number availability before publishing. Read the current options rather than hardcoding model IDs. An active agent can also be connected inside a Voice flow; this is separate from publishing phone numbers for inbound use.

Publication changes live routing. The documented API publication path enables recording by default; review its [publication notes](https://docs.gomobile.ma/developers/reference/agents.md#publish-an-agent-for-inbound-calls) before proceeding. Testing and inbound calls can consume usage.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.