Create API Key
curl --request POST \
--url https://api.entityml.com/api/v1/keysimport requests
url = "https://api.entityml.com/api/v1/keys"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.entityml.com/api/v1/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.entityml.com/api/v1/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.entityml.com/api/v1/keys"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.entityml.com/api/v1/keys")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.entityml.com/api/v1/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key_id": "<string>",
"api_key": "<string>",
"user_id": "<string>",
"name": "<string>",
"created_at": "<string>"
}
}API Keys
Create API Key
Create a new API key for a user.
POST
/
api
/
v1
/
keys
Create API Key
curl --request POST \
--url https://api.entityml.com/api/v1/keysimport requests
url = "https://api.entityml.com/api/v1/keys"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.entityml.com/api/v1/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.entityml.com/api/v1/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.entityml.com/api/v1/keys"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.entityml.com/api/v1/keys")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.entityml.com/api/v1/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key_id": "<string>",
"api_key": "<string>",
"user_id": "<string>",
"name": "<string>",
"created_at": "<string>"
}
}Request
No
Authorization header is required for this endpoint. The full API key is returned only once.Query Parameters
string
required
A name for the API key (for your reference).
string
required
The user ID to create the key for.
Response
boolean
Whether the key was created successfully.
object
Example
from entityml import EntityMLClient
client = EntityMLClient()
created = client.api_keys.create(name="my-api-key", user_id="YOUR_USER_ID")
print(created)
entityml api-keys create \
--name my-api-key \
--user-id YOUR_USER_ID
curl -X POST "https://api.entityml.com/api/v1/keys?name=my-api-key&user_id=YOUR_USER_ID"
Example response
{
"success": true,
"data": {
"key_id": "uuid-string",
"api_key": "pk_generated_api_key",
"user_id": "user-uuid",
"name": "my-api-key",
"created_at": "2025-01-15T10:30:00Z"
}
}
⌘I