# Get a credential to push an image

Source: https://docs.vlayers.ai/reference/hosting/mint-registry-credential

`POST /v1/hosting/registry-credentials` · scope `workspace:write`

Mints a short-lived credential for pushing container images to one agent's repository in VoiceLayer's registry; `voicelayer deploy` calls it for you. The credential lasts an hour, opens that repository and nothing else, and cannot place calls. The `password` is shown once.

Requires an API key with the `workspace:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `agentId` | body | string | yes | The agent whose repository the credential may push to. |

## Request

cURL:

```bash
curl -X POST https://api.vlayers.ai/v1/hosting/registry-credentials \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { repository } = await voicelayer.hosting.mintRegistryCredential({
  agentId: '0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78'
});
console.log(repository);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.hosting.mint_registry_credential(
    agent_id="0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",
)
print(result.repository)
```

## Response `201`

```json
{
  "registry": "registry.vlayers.ai",
  "repository": "0192f5a1-5e6f-7a7b-8c8d-9e0f1a2b3c45/0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",
  "username": "vlayers",
  "password": "<shown once>",
  "keyId": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",
  "expiresAt": "2026-10-20T15:04:05.000Z"
}
```
