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

# Agent setup

> Setup instructions an AI coding agent follows to connect itself to an Edge Impulse project.

<Note>
  This page is written for an AI coding agent. If you are a person, read [Install Agent Skills](/tutorials/topics/ai-agents/create-edge-impulse-skill) instead, or point your agent at this page.
</Note>

Connect this session to Edge Impulse by installing the Edge Impulse skills and confirming that a project API key works. Two steps belong to the user, not you: creating the API key in Studio and setting it in their own shell, and restarting the client so the skills and environment load. Do your part, then hand them one instruction at a time.

## Install the skills

Install the full [agent-skills catalog](/agents/skills), not a single skill. It covers the platform APIs, custom blocks, and firmware targets, and each skill loads only when a task needs it.

```bash theme={"system"}
npx skills add edgeimpulse/agent-skills --global -y
```

The CLI needs Node.js and Git, detects the installed agents, and copies every skill to each agent's skills directory. Drop `--global` to install into the current project only, or add `-a <agent>` to target a single agent. If the user's agent does not support [Agent Skills](https://agentskills.io/home), check the agent's documentation for where it loads instructions from.

If Edge Impulse skills already appear in `npx skills list --global`, run the same command anyway. It updates the installed skills to the latest version and adds any new ones, without duplicating them.

## Ask the user for credentials

The `ei-api` skill reads `EI_API_KEY` and `EI_PROJECT_ID` from the environment. Check for both before asking. If they are missing, ask the user to:

1. Open their project in [Edge Impulse Studio](https://studio.edgeimpulse.com) and copy an [API key](/studio/projects/dashboard/api-keys) from **Dashboard > Keys**, and the [project ID](/studio/projects/dashboard#project-info) from **Project info**.
2. Export both in the shell that launches the agent, or in their shell profile:

```bash theme={"system"}
export EI_API_KEY="ei_..."
export EI_PROJECT_ID="12345"
```

Never ask the user to paste the key into the conversation, and never write it into a script, skill file, `AGENTS.md`, or any other committed file. If they paste it anyway, use it for this session only and tell them to rotate it under **Dashboard > Keys**. A free account is available at [studio.edgeimpulse.com](https://studio.edgeimpulse.com).

## Verify

Ask the user to restart the client, unless the skills are already loaded and both variables are already set in this session. A variable exported in another terminal does not reach a process that is already running.

Then check which project the key belongs to:

```bash theme={"system"}
curl -s -H "x-api-key: $EI_API_KEY" \
  https://studio.edgeimpulse.com/v1/api/projects/api-key-info
```

Confirm that `projectId` in the response matches `EI_PROJECT_ID`, then fetch the [project information](/apis/studio/projects/project-information):

```bash theme={"system"}
curl -s -H "x-api-key: $EI_API_KEY" \
  "https://studio.edgeimpulse.com/v1/api/$EI_PROJECT_ID"
```

Tell the user the project name from `project.name` and the key's `role`. Never report success because a skill file or variable exists. A `401` means the key is wrong, revoked, or not exported. A `projectId` that does not match means the key belongs to a different project. Missing skills mean the restart did not happen.

## Before acting on the project

* Send the key only in the `x-api-key` header to Edge Impulse endpoints.
* Confirm with the user before deleting samples, overwriting labels, or starting long training jobs.
* Check the `success` field in every API response. Failures return `{"success": false, "error": "..."}`.
* For endpoints the skills do not cover, read the [Studio API reference](/apis/studio) or the OpenAPI spec at `https://studio.edgeimpulse.com/openapi.yml`.
