> For the complete documentation index, see [llms.txt](https://documentation.skynet.io/skynet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.skynet.io/skynet/build-your-project-on-skynet/integrate-ai-agent-tools/initialization-and-setup.md).

# Initialization and Setup

In your main application file, import and set up the `Skynet-SmartAccessPoint` with your project’s core services.

Here is an example initialization:&#x20;

```typescript
import dotenv from 'dotenv';
dotenv.config();

import express from 'express';
import { initAIAccessPoint } from '@decloudlabs/Skynet-SmartAccessPoint /lib/init';
import { checkBalance } from '@decloudlabs/Skynet-SmartAccessPoint /lib/middleware/checkBalance';
import { protect } from '@decloudlabs/Skynet-SmartAccessPoint /lib/middleware/auth';
import SkyMainNodeJS from '@decloudlabs/skynet/lib/services/SkyMainNodeJS';
import { getSkyNode } from './clients/skynet';

const app = express();
const port = process.env.PORT || 3000;

const setupAccessPoint = async () => {
    const skyNode: SkyMainNodeJS = await getSkyNode();

    await initAIAccessPoint(
        skyNode,
        checkBalanceCondition,
        applyCosts,
        app,
        runNaturalFunction
    );

    app.listen(port, () => {
        console.log(`Server running on port ${port}`);
    });
};

setupAccessPoint();
```

The `initAIAccessPoint` function sets up the necessary routes and middleware, allowing you to securely manage AI access while enforcing balance checks and service control.
