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

# Create Smart Account

> Create a new smart account for a user

<Note>
  **SDK Alternative**: Use `giza.createAgent(eoa)` for a simpler TypeScript interface. [See SDK docs](/sdk-reference/giza)
</Note>

## Description

Creates a new ZeroDev smart account for a user's externally owned account (EOA). The smart account address is **deterministic** — calling this endpoint with the same EOA and chain always returns the same address, so it is safe to call multiple times.

This is the first step in the agentic integration flow. After creating the smart account, the user deposits funds to the returned address, then you activate the agent.

## Request Body

<ParamField body="eoa" type="string" required>
  The user's externally owned account (wallet) address.
  Must be a valid Ethereum address (0x + 40 hex characters).
</ParamField>

<ParamField body="chain" type="integer" required>
  Chain ID for the smart account.

  Supported values: `1` (Ethereum), `137` (Polygon), `8453` (Base), `42161` (Arbitrum), `84532` (Base Sepolia), `11155111` (Sepolia)
</ParamField>

<ParamField body="agent_id" type="string">
  Agent identifier. Defaults to `giza-app`.
</ParamField>

## Example Request

```bash theme={null}
curl -X POST "https://partners-backend-1038109371738.europe-west1.run.app/api/v1/proxy/zerodev/smart-accounts" \
  -H "Content-Type: application/json" \
  -H "X-Partner-API-Key: your-api-key" \
  -H "X-Partner-Name: your-partner-name" \
  -d '{
    "eoa": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    "chain": 8453,
    "agent_id": "giza-app"
  }'
```

## Response

<ResponseField name="smartAccount" type="string">
  The created smart account address. This is where the user should deposit funds.
</ResponseField>

<ResponseField name="backendWallet" type="string">
  The Giza backend wallet that will hold session keys for agent operations.
</ResponseField>

```json Response Example theme={null}
{
  "smartAccount": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
  "backendWallet": "0xDeF9876543210FeDcBa9876543210FeDcBa987654"
}
```

## Error Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| `400`  | Invalid input data                        |
| `401`  | Unauthorized - invalid API key            |
| `422`  | Validation error (invalid address format) |
| `500`  | Internal server error                     |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://partners-backend-1038109371738.europe-west1.run.app/api/v1/proxy/zerodev/smart-accounts" \
    -H "Content-Type: application/json" \
    -H "X-Partner-API-Key: your-api-key" \
    -H "X-Partner-Name: your-partner-name" \
    -d '{
      "eoa": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "chain": 8453,
      "agent_id": "giza-app"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://partners-backend-1038109371738.europe-west1.run.app/api/v1/proxy/zerodev/smart-accounts',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-Partner-API-Key': 'your-api-key',
        'X-Partner-Name': 'your-partner-name',
      },
      body: JSON.stringify({
        eoa: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
        chain: 8453,
        agent_id: 'giza-app',
      }),
    }
  );

  const data = await response.json();
  console.log('Smart Account:', data.smartAccount);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://partners-backend-1038109371738.europe-west1.run.app/api/v1/proxy/zerodev/smart-accounts',
      headers={
          'X-Partner-API-Key': 'your-api-key',
          'X-Partner-Name': 'your-partner-name',
      },
      json={
          'eoa': '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
          'chain': 8453,
          'agent_id': 'giza-app',
      }
  )

  data = response.json()
  print('Smart Account:', data['smartAccount'])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "smartAccount": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
    "backendWallet": "0xDeF9876543210FeDcBa9876543210FeDcBa987654"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "detail": "Invalid input data"
  }
  ```

  ```json 422 Validation Error theme={null}
  {
    "detail": [
      {
        "loc": ["body", "eoa"],
        "msg": "Invalid Ethereum address",
        "type": "value_error"
      }
    ]
  }
  ```
</ResponseExample>
