# Visibility and calling functions

Make HTTP functions public, private or internal, and run other functions of your project or workspace from code.

## Visibility

| Visibility | Who can call it |
| --- | --- |
| **Public** (default) | Anyone with the URL (and an [API key](/api-keys), if required) |
| **Private** | Only this project: its code, schedules, MCP server and the console |
| **Internal** | Functions of any project in the same workspace |
| **HTTP off** | Like private, and it has no URL of its own |

Use private for helpers your functions share, such as a pricing calculation, and internal for services other projects in your workspace use. Private, internal and HTTP-off functions show a 🔒 in the console.

## Run another function

Every function of your project — exposed over HTTP or not — is a method on `functions`, typed from its schemas in the editor:

```js
import { functions } from 'wisp';

const { total } = await functions.price({ items });
```

```python
from wisp import functions

total = functions.price(items=items)["total"]
```

It throws a `WispError` when the function fails. GET functions get the input as query parameters. [`functions.invoke`](/api/sdk-functions) does the same by name and returns the raw response.

## Call over HTTP

HTTP functions are plain HTTP, so you can also call them with `fetch` or any client. The SDK gives you the URL and, for private and internal functions, the headers that identify your project — without them those functions refuse the call:

```js
import { functions } from 'wisp';

const res = await fetch(functions.url('accounts/users', { id: '42' }), { headers: functions.headers() }); // another project
```

During a `?test` request, `functions.url` and `functions.invoke` reach the drafts too. Full reference: [functions](/api/sdk-functions).

## Who called

The called function sees `req.caller`:

```js
req.caller // { projectId: "p...", kind: "endpoint" }
// kind: "endpoint" (your project's code), "schedule", "mcp" (the project's MCP server) or "console" (Run or Test)
```

If you check credentials in [`before`](/before-and-after), let requests with `req.caller` through.
