Ir al contenido principal

Este explorador ya no se admite.

Actualice a Microsoft Edge para aprovechar las características y actualizaciones de seguridad más recientes, y disponer de soporte técnico.

Descargar Microsoft Edge Más información sobre Internet Explorer y Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Vector stores

Get a vector store

GET /openai/v1/vector_stores/{vector_store_id}

Retrieves a vector store by its identifier.

Parámetros de la ruta de acceso

vector_store_id string requerido

The ID of the vector store to retrieve.

Respuestas

The request has succeeded.

Cuerpo

Content-Type: application/json
id string requerido

The identifier, which can be referenced in API endpoints.

object enum requerido

The object type, which is always vector_store.

vector_store
created_at integer requerido

The Unix timestamp (in seconds) for when the vector store was created.

name string requerido

The name of the vector store.

usage_bytes integer requerido
file_counts OpenAI.VectorStoreObjectFileCounts requerido
in_progress integer requerido
completed integer requerido
failed integer requerido
cancelled integer requerido
total integer requerido
status enum requerido

The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.

expiredin_progresscompleted
expires_after OpenAI.VectorStoreExpirationAfter

The expiration policy for a vector store.

anchor enum requerido

Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

last_active_at
days integer requerido
expires_at integer | null
last_active_at integer | null requerido
metadata OpenAI.Metadata | null requerido

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

[key: string] string

Client error

Cuerpo

Content-Type: application/json
error OpenAI.Error requerido
code string | null requerido
message string requerido
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Cualquiera de las siguientes:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string requerido

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Cuerpo

Content-Type: application/json
error OpenAI.Error requerido
code string | null requerido
message string requerido
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Cualquiera de las siguientes:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string requerido

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Solicitar

curl https://api.openai.com/v1/vector_stores/vs_abc123 \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "OpenAI-Beta: assistants=v2"
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
vector_store = client.vector_stores.retrieve(
    "vector_store_id",
)
print(vector_store.id)
import OpenAI from "openai";
const openai = new OpenAI();

async function main() {
  const vectorStore = await openai.vectorStores.retrieve(
    "vs_abc123"
  );
  console.log(vectorStore);
}

main();
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const vectorStore = await client.vectorStores.retrieve('vector_store_id');

console.log(vectorStore.id);
package main

import (
    "context"
    "fmt"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    vectorStore, err := client.VectorStores.Get(context.TODO(), "vector_store_id")
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", vectorStore.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.VectorStore;
import com.openai.models.vectorstores.VectorStoreRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        VectorStore vectorStore = client.vectorStores().retrieve("vector_store_id");
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

vector_store = openai.vector_stores.retrieve("vector_store_id")

puts(vector_store)

Respuesta

{
  "id": "vs_abc123",
  "object": "vector_store",
  "created_at": 1699061776
}
es-es
Sus opciones de privacidad
  • Declinación de responsabilidades de IA
  • Versiones anteriores
  • Blog
  • Contribuir
  • Privacidad
  • Privacidad de estado del consumidor
  • Términos de uso
  • Marcas comerciales
  • © Microsoft 2026