Uso y analítica
Obtener una generación
Recupera una generación específica por su ID.
GET
/
generations
Obtener una generación
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.phaseo.app/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.phaseo.app/v1/generations \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/generations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.phaseo.app/v1/generations")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"team_id": "<string>",
"app_id": "<string>",
"endpoint": "<string>",
"model_id": "<string>",
"provider": "<string>",
"native_response_id": "<string>",
"stream": true,
"byok": true,
"status_code": 123,
"success": true,
"error_code": "<string>",
"error_message": "<string>",
"latency_ms": 123,
"generation_ms": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"cost_nanos": 123,
"currency": "<string>",
"pricing_lines": [
{}
],
"key_id": "<string>",
"throughput": 123,
"replay_supported": true,
"replay_request": {}
}{
"ok": true,
"error": "<string>",
"reason": "<string>"
}{
"ok": true,
"error": "<string>"
}Llama a
Un espacio de trabajo puede limitar el contenido guardado a propietarios y administradores. Los demás, incluidas las claves de API creadas por miembros, reciben entonces
GET /v1/generations?id=<request_id> para obtener el registro de auditoría guardado de una solicitud de tu espacio de trabajo. Necesita el scope generations:read; si falta id, devuelve 400 missing_id.
Las solicitudes nuevas reciben un ID de generación G- generado por el servidor, que se devuelve en el encabezado de respuesta x-request-id y en la respuesta de la generación. Usa ese ID para los registros de solicitudes, la consulta de generaciones y el soporte. Un x-request-id enviado por quien llama no sustituye el ID de generación. Los IDs de registro UUID antiguos siguen funcionando para las consultas.
Repite una solicitud
Todas las respuestas incluyenreplay_supported. Cuando el registro de E/S guardó el cuerpo de la solicitud y tienes permiso para leer el contenido guardado, replay_supported es true y replay_request contiene el cuerpo que debes reenviar para una repetición controlada:
1
Lee la generación
Llama a
GET /v1/generations?id=<request_id>.2
Comprueba que se puede repetir
Continúa solo si
replay_supported es true.3
Envíala de nuevo
Envía
replay_request al endpoint indicado en endpoint, como /v1/chat/completions o /v1/responses.replay_request: null y los detalles de la solicitud sin su contenido.Respuesta
Datos de la generación
Última modificación el 16 de noviembre de 2026
¿Esta página le ayudó?
⌘I
Obtener una generación
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.phaseo.app/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.phaseo.app/v1/generations \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/generations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.phaseo.app/v1/generations")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"request_id": "<string>",
"team_id": "<string>",
"app_id": "<string>",
"endpoint": "<string>",
"model_id": "<string>",
"provider": "<string>",
"native_response_id": "<string>",
"stream": true,
"byok": true,
"status_code": 123,
"success": true,
"error_code": "<string>",
"error_message": "<string>",
"latency_ms": 123,
"generation_ms": 123,
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"cost_nanos": 123,
"currency": "<string>",
"pricing_lines": [
{}
],
"key_id": "<string>",
"throughput": 123,
"replay_supported": true,
"replay_request": {}
}{
"ok": true,
"error": "<string>",
"reason": "<string>"
}{
"ok": true,
"error": "<string>"
}