---
docId: doc_99a208c837ae4747bdf92ea7d02f7ee8
title: Get the environment
description: "Read the environment, packages, limits, and types for writing functions."
api:
  group: herramientas/funciones-personalizadas
  auth: bearer
  operations:
    - operationId: getFunctionsRuntime
      method: GET
      path: /v1/tools/functions/runtime
      postmanName: Get the functions environment
---

<script>
  import { Ways } from '$lib/components';
</script>

# Get the environment

Read the language, allowed packages, limits, starter template, and `@platica/functions` types. Use them before writing a function, or share them with your coding assistant to use the correct signatures.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/tools/functions/runtime" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.tools.functions.runtime();
```

</Ways.Way>
</Ways>

## Response

```json
{
  "status": "success",
  "data": {
    "language": "typescript",
    "runtime": "nodejs22.x",
    "packages": [
      { "name": "@platica/functions", "description": "defineFunction, http, secrets, log" },
      { "name": "zod", "description": "Esquema de entrada (obligatorio)" },
      { "name": "fast-xml-parser", "description": "Leer y construir XML / SOAP" },
      { "name": "date-fns", "description": "Fechas" },
      { "name": "decimal.js", "description": "Aritmética decimal exacta (dinero)" },
      { "name": "papaparse", "description": "CSV" },
      { "name": "lodash-es", "description": "Utilidades de colecciones" }
    ],
    "limits": { "functionsPerWorkspace": 20, "timeoutSeconds": { "min": 1, "max": 60, "default": 20 }, "memoryMb": 256 },
    "template": "import { z } from \"zod\";\nimport { defineFunction } from \"@platica/functions\";\n\nexport default defineFunction({ … });\n",
    "typesDts": "declare module \"@platica/functions\" { … }"
  }
}
```

`limits`, `template` and `typesDts` are trimmed in the example. The package descriptions come in Spanish.

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `language` | string | `typescript` |
| `runtime` | string | The Node.js version the code runs on |
| `packages` | array | The packages the code can import, with `name` and a short description |
| `limits` | object | The limits, with the fields of [Get usage](/api-reference/custom-functions/usage#response-fields) |
| `template` | string | The code a function created without `source` starts with |
| `typesDts` | string | The TypeScript types of `@platica/functions` |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `403` | `FORBIDDEN` | The person behind the token does not have access to Integrations |

## Notes

- Platica extends the package list; you cannot add others.
- You can store `typesDts` in your repository so your editor checks the code before you [verify it](/api-reference/custom-functions/verify).
