> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_environment

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_environment.rs#L20-L29)
pub async fn [create\_environment](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-environment.md#method.create_environment)( \&self, environment\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateEnvironmentResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a UDF environmentCreates a new environment which can be used by user-defined functions (UDF).

##### Arguments

<ul>
  <li>`environment_name` - Name of the environment to be created.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_environment.rs#L41-L57)
pub async fn [create\_environment\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-environment.md#method.create_environment_with_opts)( \&self, environment\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateEnvironmentRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateEnvironmentResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a UDF environmentCreates a new environment which can be used by user-defined functions (UDF).

##### Arguments

<ul>
  <li>`environment_name` - Name of the environment to be created.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_environment.rs#L60-L71)
pub async fn [create\_environment\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-environment.md#method.create_environment_raw)( \&self, request: &[CreateEnvironmentRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateEnvironmentResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateEnvironmentRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentRequest) to the `/create/environment` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_environment.rs#L75-L87)
pub async fn [create\_environment\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-environment.md#method.create_environment_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateEnvironmentRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateEnvironmentResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateEnvironmentRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateEnvironmentRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.