# How can I get the dynamic public endpoint of my application?

**URL:** <https://community.okteto.com/t/how-can-i-get-the-dynamic-public-endpoint-of-my-application/133>\
**Category:** How Do I?\
**Created:** [June 29, 2022, 9:48pm UTC](https://community.okteto.com/t/how-can-i-get-the-dynamic-public-endpoint-of-my-application/133 "2022-06-29T21:48:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pchico83](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/pchico83/32/25_2.png) [@pchico83](https://community.okteto.com/u/pchico83)\
**Post date:** [June 29, 2022, 9:48pm UTC](https://community.okteto.com/t/how-can-i-get-the-dynamic-public-endpoint-of-my-application/133/1 "2022-06-29T21:48:57Z")

</div>

My application code needs to know the public URL where the application is exposed. This public endpoint depends on the okteto namespace where the application is deployed, and also the okteto cluster where the app is running.  
How can I infer the public URL programmatically?

---

<div class="post-metadata">

**Author:** ![pchico83](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/pchico83/32/25_2.png) [@pchico83](https://community.okteto.com/u/pchico83)\
**Post date:** [June 29, 2022, 9:52pm UTC](https://community.okteto.com/t/how-can-i-get-the-dynamic-public-endpoint-of-my-application/133/2 "2022-06-29T21:52:34Z")

</div>

Okteto automatically injects the environment variables `OKTETO_NAMESPACE` and `OKTETO_DOMAIN` on every pod. For example, when a pod is created in Okteto Cloud, in the `cindy` namespace, the following environment variables are automatically created:

- `OKTETO_NAMESPACE=cindy`
- `OKTETO_DOMAIN=cloud.okteto.net`

These environment variables make it possible to infer the public endpoint of your application. For example, if your service is called `api`, it will be exposed on:

https://+ `api`+ `-` + ${OKTETO\_NAMESPACE} + `.` + ${OKTETO\_DOMAIN}
