> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/getting-started/get-started-with-esw/ai-coding-agents/codex.md).

# Codex

Install the ESW skill and docs MCP server in OpenAI Codex.

{% stepper %}
{% step %}

### Install the ESW skill

Download [esw-api-integration.zip](https://developer.esw.com/esw-api-integration.zip) and unzip it into a skills folder Codex reads:

```sh
curl -L -o esw-api-integration.zip https://developer.esw.com/esw-api-integration.zip

# For this repository only (commit it so your team gets it too)
unzip esw-api-integration.zip -d .agents/skills/

# Or for every project on your machine
unzip esw-api-integration.zip -d ~/.agents/skills/
```

Codex reads `.agents/skills/` at the repository root, in the folder you start Codex from, and in its parent. Keep the folder name `esw-api-integration`: it must match the skill's name.
{% endstep %}

{% step %}

### Add the docs MCP server

Add this to `~/.codex/config.toml` (or to `.codex/config.toml` in a trusted project):

```toml
[mcp_servers.esw-docs]
url = "https://developer.esw.com/~gitbook/mcp"
```

{% endstep %}

{% step %}

### Point your project instructions at AGENTS.md

Add this line to the `AGENTS.md` at your repository root:

```markdown
When working with ESW (eShopWorld) APIs, follow https://developer.esw.com/agents.md. Use the ESW sandbox unless told otherwise.
```

{% endstep %}

{% step %}

### Set your sandbox credentials

Set `ESW_CLIENT_ID`, `ESW_CLIENT_SECRET` and `ESW_TENANT_CODE` as environment variables. Keep them out of your repository.
{% endstep %}

{% step %}

### Check it works

Start Codex in your repository and ask:

> Using the ESW skill, get a sandbox token and run the ESW smoke test.
> {% endstep %}
> {% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.esw.com/getting-started/get-started-with-esw/ai-coding-agents/codex.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
