メイン コンテンツにスキップ

このブラウザーはサポートされなくなりました。

Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。

Microsoft Edge をダウンロードする Internet Explorer と Microsoft Edge の詳細情報
microsoft-foundry.rest.security.o-auth2-auth

Assistants

Get an assistant

GET /openai/v1/assistants/{assistant_id} 非推奨

Retrieves an assistant by its identifier.

パス パラメーター

assistant_id string 必須 非推奨

The ID of the assistant to retrieve.

応答

The request has succeeded.

本文

Content-Type: application/json
id string 必須 非推奨

The identifier, which can be referenced in API endpoints.

object enum 必須 非推奨

The object type, which is always assistant.

assistant
created_at integer 必須 非推奨

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

name string | null 必須 非推奨
description string | null 必須 非推奨
model string 必須 非推奨

ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

instructions string | null 必須 非推奨
tools OpenAI.AssistantTool[] 必須 非推奨

A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, file_search, or function.

tool_resources OpenAI.AssistantObjectToolResources | null 非推奨
code_interpreter OpenAI.AssistantObjectToolResourcesCodeInterpreter 非推奨
file_ids string[] 非推奨
file_search OpenAI.AssistantObjectToolResourcesFileSearch 非推奨
vector_store_ids string[] 非推奨
metadata OpenAI.Metadata | null 必須 非推奨

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 非推奨
temperature number | null 非推奨
top_p number | null 非推奨
response_format enum | OpenAI.ResponseFormatText | OpenAI.ResponseFormatJsonObject | OpenAI.ResponseFormatJsonSchema | null 非推奨

Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106. Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide. Setting to { "type": "json_object" } enables JSON mode, which ensures the message the model generates is valid JSON. Important:* when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.

次のいずれか:
enum 非推奨
auto
type enum 必須 非推奨

The type of response format being defined. Always text.

text
type enum 必須 非推奨

The type of response format being defined. Always json_object.

json_object
type enum 必須 非推奨

The type of response format being defined. Always json_schema.

json_schema
json_schema OpenAI.ResponseFormatJsonSchemaJsonSchema 必須 非推奨
description string 非推奨
name string 必須 非推奨
schema OpenAI.ResponseFormatJsonSchemaSchema 非推奨

The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.

strict boolean | null 非推奨

Client error

本文

Content-Type: application/json
error OpenAI.Error 必須 非推奨
code string | null 必須 非推奨
message string 必須 非推奨
param string | null 非推奨
type string 非推奨
misalignment OpenAI.MisalignmentErrorDetailsResource 非推奨
review_target string | null 非推奨
error_type string | enum 非推奨
次のいずれか:
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 必須 非推奨

The public continuation instruction.

details OpenAI.Error[] 非推奨

Additional errors that contributed to this failure.

additionalInfo object 非推奨

Additional structured information about the failure.

debugInfo object 非推奨

Diagnostic information supplied by the service for troubleshooting.

Server error

本文

Content-Type: application/json
error OpenAI.Error 必須 非推奨
code string | null 必須 非推奨
message string 必須 非推奨
param string | null 非推奨
type string 非推奨
misalignment OpenAI.MisalignmentErrorDetailsResource 非推奨
review_target string | null 非推奨
error_type string | enum 非推奨
次のいずれか:
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 必須 非推奨

The public continuation instruction.

details OpenAI.Error[] 非推奨

Additional errors that contributed to this failure.

additionalInfo object 非推奨

Additional structured information about the failure.

debugInfo object 非推奨

Diagnostic information supplied by the service for troubleshooting.

要求

curl https://api.openai.com/v1/assistants/asst_abc123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -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
)
assistant = client.beta.assistants.retrieve(
    "assistant_id",
)
print(assistant.id)
import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const myAssistant = await openai.beta.assistants.retrieve(
    "asst_abc123"
  );

  console.log(myAssistant);
}

main();
import OpenAI from 'openai';

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

const assistant = await client.beta.assistants.retrieve('assistant_id');

console.log(assistant.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"),
    )
    assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id")
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", assistant.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.assistants.Assistant;
import com.openai.models.beta.assistants.AssistantRetrieveParams;

public final class Main {
    private Main() {}

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

        Assistant assistant = client.beta().assistants().retrieve("assistant_id");
    }
}
require "openai"

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

assistant = openai.beta.assistants.retrieve("assistant_id")

puts(assistant)

回答

{
  "id": "asst_abc123",
  "object": "assistant",
  "created_at": 1699009709,
  "name": "HR Helper",
  "description": null,
  "model": "gpt-4o",
  "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies.",
  "tools": [
    {
      "type": "file_search"
    }
  ],
  "metadata": {},
  "top_p": 1.0,
  "temperature": 1.0,
  "response_format": "auto"
}
ja-jp
プライバシーの選択
  • AI 免責事項
  • 以前のバージョン
  • ブログ
  • 投稿
  • プライバシー
  • コンシューマーの健康に関するプライバシー
  • 利用条件
  • 商標
  • © Microsoft 2026