Creates a new key for a project
POST/projects/ {projectId}/ ai-hosting-keys/
v2
POST
ai-hosting-project-create-key
Creates a new key for a project. Same as the customer route but with required projectId. And project users can create it.
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"createWebuiContainer":true,"name":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/ai-hosting-keys
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.aiHosting.aiHostingProjectCreateKey({
"projectId": "string",
"data": {
"createWebuiContainer": true,
"name": "string"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingProjectCreateKey\AiHostingProjectCreateKeyRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingProjectCreateKey\AiHostingProjectCreateKeyRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// AiHostingProjectCreateKeyRequestBody to learn how to construct a valid instance
$body = new AiHostingProjectCreateKeyRequestBody(/* TODO: ... */);
$request = (new AiHostingProjectCreateKeyRequest(
projectId: "string",
body: $body
));
$response = $client->aiHosting()->aiHostingProjectCreateKey($request);
var_dump($response->getBody();