JUST TEN years ago Robert Culp and Bill Cosby were at the height of their popularity, whamming their way through a series of complex mysteries as two U.S. undercover agents in the television drama, "I Spy."

Culp masqueraded as an international tennis champion; Cosby as his trainer-masseur. On the set, Culp always got the lady; in real life, Cosby got the awards, Emmys for the best dramatic actor three years in a row.

Now the foolish grin of Bill Cosby pops up every few minutes on the screen, pushing cars, green peas and jello-pudding.

Where is Robert Culp? Busy in his home in Beverly Hills, pursuing, he says, "the high-rolling career of writer and director." Generally, he adds, living the good life with his fourth wife, Sheila Sullivan, and his four children. "Right now I am looking at a bookcase that's about eight feet tall and has nine projects in various stages. That represents the last five years' work," says Culp.

Over the telephone Culp sounds very positive about his career, but periodically a wistfulness seeps through, almost as if he heard the Hollywood writer say, "Culp? He's sort of dropped out of sight." At one point, Culp says, to do all these things, write, interest the producers, sell the property, a man should be 25, every energy is needed, but I enjoy what I do."

Now 47, Culp hasn't had a smash hit on television since "I Spy," which ran from 1965 to 1968, or in the movies since "Bob and Carol and Ted and Alice" in 1969. He has worked regularly, appearing in a few episodes of "Police Story," "The Name of the Game" and "Colombo". In 1975 he stared in "A Cry for Help," a made-for-television movie about a disc jockey and a potential suicide. It was nominated for an Emmy.

A few years ago he did direct and star in with Cosby an adventure movie called "Hickey and Boggs," says Culp. "It became a cult film, not Culp. It didn't earn me a nickel but the folks on the campuses like it and it is used in several film courses."

The rapport of Culp and Cosby grew into a real friendship that continues. Culp says he wasn't jealous when Cosby walked away with the awards.

"No, I was the proudest man around," he says.

In the spring of 1968, when Martin Luther King Jr. was shot, Culp and Cosby went to Memphis and joined the marching garbage workers whom King had been helping. After the funeral, Culp recalls, "Bill, Sidney and I were sitting around, talking about what we could do. I decided to do a film on the Southern Christian Leadership Conference's Operation Breadbasket. A few months later I was the only one still doing my project. I had invested all my money. I was broke and Bill came along and bailed me out." The documentary, which later appeared on television was nominated for an Emmy.

For a number of years Culp was very active in political fund raising and the celebrity tennis circuit. Now he stays away from both. "I'm no longer the political activist because one of the things Jesse Jackson said to me was it's terrific what you are doing but you will have to go back to work because your presence is needed." So I am concentrating on what I have wanted to do," he says. "And when they call me for the tennis tournaments, I am always out of shape, so I refuse to go."

Right now, he says, he's happiest when he locks the door to his den, turns off the telephone and writes. "In that body of work is one recurrent theme, the love between a father and son. All of them are romances of a sort," he says. "The satisfaction I get from writing is the feeling that you are a god, you are creating a world from scratch."